Skip to content

Commit 90823f7

Browse files
committed
Update completion model + small improvements
1 parent 16d4100 commit 90823f7

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Improve chat title generation.
66
- Fix completion error handling.
7+
- Default to `openai/gpt-4.1` on completion.
78

89
## 0.73.0
910

docs/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ You can configure which model and system prompt ECA will use during its inline c
399399
```javascript title="~/.config/eca/config.json"
400400
{
401401
"completion": {
402-
"model": "github-copilot/gpt-4o",
402+
"model": "github-copilot/gpt-4.1",
403403
"systemPromptFile": "/path/to/my-prompt.md"
404404
}
405405
}
@@ -583,7 +583,7 @@ To configure, add your OTLP collector config via `:otlp` map following [otlp aut
583583
}
584584
},
585585
"completion": {
586-
"model": "openai/gpt-4o",
586+
"model": "openai/gpt-4.1",
587587
"systemPromptFile": "prompts/inline_completion.md"
588588
}
589589
}

src/eca/config.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
:index {:ignoreFiles [{:type :gitignore}]
120120
:repoMap {:maxTotalEntries 800
121121
:maxEntriesPerDir 50}}
122-
:completion {:model "openai/gpt-4o"
122+
:completion {:model "openai/gpt-4.1"
123123
:systemPromptFile "prompts/inline_completion.md"}})
124124

125125

src/eca/features/completion.clj

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@
6262
{:keys [line character]} position
6363
input-code (insert-completion-tag doc-text position)
6464
instructions (f.prompt/inline-completion-prompt config)
65-
{:keys [error result]} (llm-api/sync-prompt!
66-
{:provider provider
67-
:model model
68-
:config config
69-
:prompt input-code
70-
:instructions instructions
71-
:provider-auth provider-auth
72-
:model-capabilities model-capabilities})]
65+
{:keys [error result]} (deref (future
66+
(llm-api/sync-prompt!
67+
{:provider provider
68+
:model model
69+
:config config
70+
:prompt input-code
71+
:instructions instructions
72+
:provider-auth provider-auth
73+
:model-capabilities (assoc model-capabilities
74+
:reason? false
75+
:tools false
76+
:web-search false)}))
77+
30000 ;; TODO move to config
78+
{:error {:message "Timeout waiting for completion"}})]
7379
(cond
7480
(:message error)
7581
{:error {:type :warning

src/eca/llm_api.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,4 +275,5 @@
275275
:past-messages past-messages
276276
:user-messages (or user-messages
277277
[{:role "user" :content [{:type :text :text prompt}]}])
278-
:config config}))
278+
:config config
279+
:on-error (fn [error] {:error error})}))

0 commit comments

Comments
 (0)