From 3c0adec8e3a9dd3bc34251e87e0fb5314793426d Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 23 Dec 2025 18:24:42 +0000 Subject: Add claude opus/sonnet support --- makima/frontend/src/lib/api.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'makima/frontend/src/lib') 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 { // Chat API function export async function chatWithFile( id: string, - message: string + message: string, + model?: LlmModel ): Promise { + 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(); -- cgit v1.2.3