feat(agent): route chat through selected model
This commit is contained in:
@@ -13,8 +13,8 @@ export type {
|
||||
export { getLlmConfig, isLlmConfigured } from "./config";
|
||||
export { createMockLlmClient } from "./mock";
|
||||
|
||||
export function createLlmClient(override?: LlmClient): LlmClient {
|
||||
if (override) return override;
|
||||
export function createLlmClient(options?: { model?: string; override?: LlmClient }): LlmClient {
|
||||
if (options?.override) return options.override;
|
||||
|
||||
const config = getLlmConfig();
|
||||
if (config.provider === "mock" || !config.baseUrl) {
|
||||
@@ -24,6 +24,6 @@ export function createLlmClient(override?: LlmClient): LlmClient {
|
||||
return createOpenAiCompatibleClient({
|
||||
baseUrl: config.baseUrl,
|
||||
apiKey: config.apiKey,
|
||||
model: config.model,
|
||||
model: options?.model ?? config.model,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user