Skip to content

Commit 021abbb

Browse files
committed
Update the default chat prompt
1 parent 65c1e31 commit 021abbb

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Core/Sources/ChatService/ContextAwareAutoManagedChatGPTMemory.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public final class ContextAwareAutoManagedChatGPTMemory: ChatGPTMemory {
4444
systemPrompt: """
4545
\(chatService?.systemPrompt ?? "")
4646
\(chatService?.extraSystemPrompt ?? "")
47-
""",
47+
""".trimmingCharacters(in: .whitespacesAndNewlines),
4848
content: content ?? ""
4949
)
5050
return await memory.generatePrompt()

Core/Sources/ChatService/DynamicContextController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ final class DynamicContextController {
106106
let contextualSystemPrompt = """
107107
\(language.isEmpty ? "" : "You must always reply in \(language)")
108108
\(systemPrompt)
109-
"""
109+
""".trimmingCharacters(in: .whitespacesAndNewlines)
110110
await memory.mutateSystemPrompt(contextualSystemPrompt)
111111
await memory.mutateContextSystemPrompt(contextSystemPrompt)
112112
await memory.mutateRetrievedContent(retrievedContent.map(\.document))

Tool/Sources/Preferences/Keys.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,10 @@ public extension UserDefaultPreferenceKeys {
398398
var defaultChatSystemPrompt: PreferenceKey<String> {
399399
.init(
400400
defaultValue: """
401-
You are an AI programming assistant.
402-
Your reply should be concise, clear, informative and logical.
403-
Your reply should be formatted in Markdown.
401+
You are a helpful senior programming assistant.
402+
You should respond in natural language.
403+
Your response should be correct, concise, clear, informative and logical.
404+
Use markdown if you need to present code, table, list, etc.
404405
If you are asked to help perform a task, you MUST think step-by-step, then describe each step concisely.
405406
If you are asked to explain code, you MUST explain it step-by-step in a ordered list concisely.
406407
Make your answer short and structured.

0 commit comments

Comments
 (0)