Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
working on conversation summaries
Dane Schneider5da0fafc3c88
diff --git a/server/model/summarize.go b/server/model/summarize.goindex 1089dbb9..383edae9 100644--- a/server/model/summarize.go+++ b/server/model/summarize.go@@ -78,15 +78,28 @@ func ShortSummary(text string) ([]byte, int, error) {}func PlanSummary(conversation []*shared.ConversationMessage) ([]byte, int, error) {- messages := []openai.ChatCompletionMessage{}+ messages := []openai.ChatCompletionMessage{+ {+ Role: openai.ChatMessageRoleSystem,+ Content: "You are Plandex, an AI programming and system administration assistant. You and the programmer collaborate to create a 'plan' for the task at hand.",+ },+ }for _, msg := range conversation {messages = append(messages, msg.Message)}messages = append(messages, openai.ChatCompletionMessage{- Role: openai.ChatMessageRoleUser,- Content: ``,+ Role: openai.ChatMessageRoleUser,+ Content: `+ Based on the conversation so far, make a summary of the current state of the plan so far.++ - It should begin with a summary of the user's messages, with particular focus any tasks they have given you. Your summary of the tasks should reflect the latest version of each task--if they have changed over time, summarize the latest state of each task that was given. Condense this information as much as possible while still being clear and retaining the meaning of the original messages.++ - Next, if the plan includes a statement from the assistant to the effect of "I will break this large task into subtasks" and the plan has been broken down into subtasks, include those subtasks in the summary as a numbered list. Condense these as much as possible while still being clear and retaining the meaning of each subtask. At the end of the list, state which subtask is currently being worked on (unless they are all finished, in which case state that they are all finished).++ - Last, summarize the latest version of the plan and any changes you have suggested. If the some of the older changes have been overridden by newer changes, you should only include the newest changes and omit the older ones. If your responses include code blocks labelled with file paths, include the latest state of your modifications to each file's code and label them with file paths in the same way as the original messages. Do not make new changes to the plan or to suggested code changes in your summary.+ `,})resp, err := Client.CreateChatCompletion(