diff options
Diffstat (limited to 'makima/frontend/src/lib')
| -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(); |
