Skip to content

Commit 5ed0219

Browse files
committed
Adjust prompt for prompt to code
1 parent f5195b7 commit 5ed0219

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Core/Sources/PromptToCodeService/OpenAIPromptToCodeAPI.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
3131
if code.isEmpty {
3232
return """
3333
You are a senior programer in writing code in \(language.rawValue).
34+
35+
File url: \(fileURL)
36+
37+
\(extraSystemPrompt ?? "")
3438
3539
Please write a piece of code that meets my requirements. The indentation should be \(
3640
indentRule
@@ -39,22 +43,22 @@ final class OpenAIPromptToCodeAPI: PromptToCodeAPI {
3943
Please reply to me start with the code block, followed by a clear and concise description in 1-3 sentences about what you did \(
4044
textLanguage
4145
).
42-
43-
\(extraSystemPrompt ?? "")
4446
"""
4547
} else {
4648
return """
4749
# Description
4850
4951
You are a senior programer in writing code in \(language.rawValue).
52+
53+
File url: \(fileURL)
54+
55+
\(extraSystemPrompt ?? "")
5056
5157
Please mutate the following code fragment with my requirements. Keep the original indentation. Do not add comments unless told to.
5258
5359
Please reply to me start with the code block followed by a clear and concise description about what you did in 1-3 sentences \(
5460
textLanguage
5561
).
56-
57-
\(extraSystemPrompt ?? "")
5862
5963
# Code
6064

0 commit comments

Comments
 (0)