File tree Expand file tree Collapse file tree 5 files changed +11
-14
lines changed
integration-test/integration Expand file tree Collapse file tree 5 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 2121 (eca/request! (fixture/initialize-request
2222 {:initializationOptions
2323 (merge fixture/default-init-options
24- {:defaultModel " foo-1"
24+ {:defaultModel " myProvider/ foo-1"
2525 :customProviders
2626 {" myProvider"
2727 {:api " openai-responses"
144144 (eca/request! (fixture/initialize-request
145145 {:initializationOptions
146146 (merge fixture/default-init-options
147- {:defaultModel " deepseek-coder"
147+ {:defaultModel " myProvider/ deepseek-coder"
148148 :customProviders
149149 {" myProvider"
150150 {:api " openai-chat"
Original file line number Diff line number Diff line change 8282 :chatWelcomeMessage " Welcome to ECA!\n\n Type '/' for commands\n\n " }
8383 (eca/request! (fixture/initialize-request
8484 {:initializationOptions (merge fixture/default-init-options
85- {:defaultModel " bar-2"
85+ {:defaultModel " myCustom/ bar-2"
8686 :customProviders
8787 {" myCustom" {:api " openai"
8888 :urlEnv " MY_CUSTOM_API_URL"
Original file line number Diff line number Diff line change 2424 (fn [models [custom-provider {provider-models :models }]]
2525 (reduce
2626 (fn [m model]
27- (let [known-model (get all-models model)]
27+ (let [known-model (get all-models model)
28+ full-model (str (name custom-provider) " /" model)]
2829 (assoc m
29- ( str ( name custom-provider) " / " model)
30+ full- model
3031 {:tools (or (:tools known-model) true )
3132 :reason? (or (:reason? known-model) true )
3233 :web-search (or (:web-search known-model) true )
3334 :max-output-tokens (:max-output-tokens known-model)
3435 :custom-provider? true
35- :default-model? (= model (:defaultModel config))})))
36+ :default-model? (= full- model (:defaultModel config))})))
3637 models
3738 provider-models))
3839 {}
Original file line number Diff line number Diff line change 6363 - Anthropic default model."
6464 [db config]
6565 (let [[decision model]
66- (or (when-let [custom-provider-default-model (first (keep (fn [[model config]]
67- (when (and (:custom-provider? config)
68- (:default-model? config))
69- model))
70- (:models db)))]
71- [:custom-provider-default-model custom-provider-default-model])
66+ (or (when-let [config-default-model (:defaultModel config)]
67+ [:config-default-model config-default-model])
7268 (when (provider-api-key " anthropic" config)
7369 [:api-key-found " anthropic/claude-sonnet-4-20250514" ])
7470 (when (provider-api-key " openai" config)
Original file line number Diff line number Diff line change 1010(deftest default-model-test
1111 (testing " Custom provider default-model? present"
1212 (with-redefs [config/get-env (constantly nil )]
13- (let [db {:models { " my-provider/my-model " { :custom-provider? true :default-model? true }} }
14- config {}]
13+ (let [db {}
14+ config {:defaultModel " my-provider/my-model " }]
1515 (is (= " my-provider/my-model" (llm-api/default-model db config ))))))
1616
1717 (testing " Ollama running model present"
You can’t perform that action at this time.
0 commit comments