From 80597cd3fdf149cef87db55f03a3cc0bfd723a7a Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 29 May 2025 11:58:40 -0400 Subject: type error fix --- js/src/llm/llm.ts | 17 +++++++++-------- js/src/llm/models/anthropic.ts | 0 js/src/llm/models/index.ts | 1 - js/src/llm/models/model.ts | 11 ----------- 4 files changed, 9 insertions(+), 20 deletions(-) delete mode 100644 js/src/llm/models/anthropic.ts delete mode 100644 js/src/llm/models/index.ts delete mode 100644 js/src/llm/models/model.ts (limited to 'js/src/llm') diff --git a/js/src/llm/llm.ts b/js/src/llm/llm.ts index e6230584a..990c30069 100644 --- a/js/src/llm/llm.ts +++ b/js/src/llm/llm.ts @@ -1,11 +1,12 @@ -import { App } from "../app"; +import { App } from "../app/app"; import { Log } from "../util/log"; import { mergeDeep } from "remeda"; import path from "path"; +import { Provider } from "../provider/provider"; -import type { LanguageModel, Provider } from "ai"; +import type { LanguageModel, Provider as ProviderInstance } from "ai"; import { NoSuchModelError } from "ai"; -import { Config } from "../app/config"; +import { Config } from "../config/config"; import { BunProc } from "../bun"; import { Global } from "../global"; @@ -18,7 +19,7 @@ export namespace LLM { } } - const NATIVE_PROVIDERS: Record = { + const NATIVE_PROVIDERS: Record = { anthropic: { models: { "claude-sonnet-4-20250514": { @@ -76,18 +77,18 @@ export namespace LLM { google: ["GOOGLE_GENERATIVE_AI_API_KEY"], }; - const state = App.state("llm", async (app) => { + const state = App.state("llm", async () => { const config = await Config.get(); const providers: Record< string, { - info: Config.Provider; - instance: Provider; + info: Provider.Info; + instance: ProviderInstance; } > = {}; const models = new Map< string, - { info: Config.Model; instance: LanguageModel } + { info: Provider.Model; instance: LanguageModel } >(); const list = mergeDeep(NATIVE_PROVIDERS, config.providers ?? {}); diff --git a/js/src/llm/models/anthropic.ts b/js/src/llm/models/anthropic.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/js/src/llm/models/index.ts b/js/src/llm/models/index.ts deleted file mode 100644 index f974b4d3e..000000000 --- a/js/src/llm/models/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * as anthropic from "./anthropic"; diff --git a/js/src/llm/models/model.ts b/js/src/llm/models/model.ts deleted file mode 100644 index e78dbb87f..000000000 --- a/js/src/llm/models/model.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface ModelInfo { - cost: { - input: number; - inputCached: number; - output: number; - outputCached: number; - }; - contextWindow: number; - maxTokens: number; - attachment: boolean; -} -- cgit v1.2.3