Skip to content

Commit

Permalink
semantics: add link to chat with similar conversations
Browse files Browse the repository at this point in the history
  • Loading branch information
LinqLover committed Jun 19, 2024
1 parent 25bd789 commit 7dc692e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
actions
chatWithSimilarConversations

^ SemanticConversation newStreaming
addSystemMessage: 'Read the following conversations on the Squeak mailing list, squeak-dev, and prepare to summarize them for answering a question:';
addUserMessage: ((similarConversations collect: [:ea | '```{1}```' format: {ea fullTextForSummary}]) joinSeparatedBy: String cr, String cr);
addSystemMessage: 'The following message has been posted later on squeak-dev. Please read it to find out if any of the provided conversations from above are relevant to the new message:';
addUserMessage: self conversation fullTextForSummary;
addSystemMessage: 'Briefly summarize each of the older conversations in the context of the new message. Each summary must be exactly one short sentence. Write each sentence on a new line and start each line with the subject of the original conversation. Focus on the outcomes of each conversation (i.e., gained insights/implemented code changes/unresolved issues) and not so much on people.';
addAssistantMessage: 'What would you like to know?';
open
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
accessing - text
similarConversationsText

| texts text chatText |
similarConversations ifNil: [
self requestSimilarConversations.
^ self similarConversationsText].
Expand All @@ -14,7 +15,7 @@ similarConversationsText
similarConversations ifEmpty: [^ '(none found)'].

self flag: #mid. "Use URLs to copyable message ids here once we support them"
^ ((similarConversations collect: [:conversation |
texts := similarConversations collect: [:conversation |
(conversation isTalkSemanticMessagesPlaceholder
ifTrue:
[conversation title asText
Expand All @@ -23,5 +24,12 @@ similarConversationsText
ifFalse:
[conversation subject asText])
addAttribute: (PluggableTextAttribute evalBlock: [conversation browse]);
yourself])
fold: [:a :b | a , String cr , b])
yourself].
text := (texts collect: [:ea | ('*' , Character nbsp) asText , ea])
fold: [:a :b | a , String cr , b].

chatText := '[Chat]' asText
addAttribute: (PluggableTextAttribute evalBlock: [self chatWithSimilarConversations]);
yourself.

^ text , String cr , String cr , chatText
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
"cancelSmartSummary" : "ct 8/21/2023 02:34",
"changed:with:" : "ct 8/27/2023 23:57",
"chatWithConversation" : "ct 6/19/2024 18:02",
"chatWithSimilarConversations" : "ct 6/19/2024 18:02",
"conversation" : "ct 8/21/2023 02:26",
"initializeForBrowser:" : "ct 8/27/2023 22:04",
"requestSimilarConversations" : "ct 8/27/2023 21:59",
"requestSmartSummary" : "ct 8/27/2023 21:59",
"rerequestSmartSummary" : "ct 8/21/2023 02:20",
"similarConversations" : "ct 8/21/2023 02:59",
"similarConversationsHeader" : "ct 8/21/2023 03:01",
"similarConversationsText" : "ct 8/26/2023 15:51",
"similarConversationsText" : "ct 12/15/2023 00:12",
"smartCancelIcon" : "ct 8/21/2023 02:28",
"smartChatIcon" : "ct 8/21/2023 02:28",
"smartRerequestIcon" : "ct 8/21/2023 02:28",
Expand Down

0 comments on commit 7dc692e

Please sign in to comment.