diff options
| author | soryu <soryu@soryu.co> | 2025-12-23 18:24:42 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2025-12-23 18:24:42 +0000 |
| commit | 3c0adec8e3a9dd3bc34251e87e0fb5314793426d (patch) | |
| tree | 9dfe61e55bd703aa09df03abfcbf8e7a8b2babce /makima/frontend/src/lib/api.ts | |
| parent | 555061b179b8ec034cb70f9a2dd6c823ced0f637 (diff) | |
| download | soryu-3c0adec8e3a9dd3bc34251e87e0fb5314793426d.tar.gz soryu-3c0adec8e3a9dd3bc34251e87e0fb5314793426d.zip | |
Add claude opus/sonnet support
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index 5ef9c22..6f7071d 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -108,9 +108,13 @@ export interface UpdateFileRequest { body?: BodyElement[]; } +// Available LLM models +export type LlmModel = "claude-sonnet" | "claude-opus" | "groq"; + // Chat API types export interface ChatRequest { message: string; + model?: LlmModel; } export interface ToolCallInfo { @@ -184,12 +188,17 @@ export async function deleteFile(id: string): Promise<void> { // Chat API function export async function chatWithFile( id: string, - message: string + message: string, + model?: LlmModel ): Promise<ChatResponse> { + const body: ChatRequest = { message }; + if (model) { + body.model = model; + } const res = await fetch(`${API_BASE}/api/v1/files/${id}/chat`, { method: "POST", headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ message }), + body: JSON.stringify(body), }); if (!res.ok) { const errorText = await res.text(); |
