Skip to content

Commit 70ba5ae

Browse files
authored
Merge pull request #41 from editor-code-assistant/system-prompt-from-file
System prompt from file
2 parents aa5a8d5 + b41fb0f commit 70ba5ae

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
- Support loading system prompts from a file.
6+
- Fix model name parsing.
7+
58
## 0.23.1
69

710
- Fix openai reasoning not being included in messages.
@@ -159,7 +162,7 @@
159162

160163
## 0.10.2
161164

162-
- Fix usage metrics for anthropic models.
165+
- Fix usage metrics for anthropic models.
163166

164167
## 0.10.1
165168

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ interface Config {
185185
anthropicApiKey?: string;
186186
rules: [{path: string;}];
187187
commands: [{path: string;}];
188-
systemPromptTemplate?: string;
188+
systemPromptTemplateFile?: string;
189189
nativeTools: {
190190
filesystem: {enabled: boolean};
191191
shell: {enabled: boolean;

src/eca/features/prompt.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
(def ^:private agent-behavior (memoize agent-behavior*))
2323

2424
(defn ^:private eca-prompt [behavior config]
25-
(let [prompt (or (:systemPromptTemplate config)
25+
(let [prompt (or (some-> (:systemPromptTemplateFile config) slurp)
2626
(base-prompt-template))]
2727
(reduce
2828
(fn [p [k v]]

src/eca/llm_api.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
callbacks)
173173

174174
(contains? custom-models model)
175-
(let [[provider model] (string/split model #"/")
175+
(let [[provider model] (string/split model #"/" 2)
176176
provider-config (get custom-providers (keyword provider))
177177
provider-fn (case (:api provider-config)
178178
"openai" llm-providers.openai/completion!

0 commit comments

Comments
 (0)