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/components/files/CliInput.tsx | 27 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'makima/frontend/src/components/files') diff --git a/makima/frontend/src/components/files/CliInput.tsx b/makima/frontend/src/components/files/CliInput.tsx index b20eb27..1dcc884 100644 --- a/makima/frontend/src/components/files/CliInput.tsx +++ b/makima/frontend/src/components/files/CliInput.tsx @@ -1,5 +1,5 @@ import { useState, useCallback, useRef, useEffect } from "react"; -import { chatWithFile, type BodyElement } from "../../lib/api"; +import { chatWithFile, type BodyElement, type LlmModel } from "../../lib/api"; interface CliInputProps { fileId: string; @@ -13,11 +13,18 @@ interface Message { toolCalls?: { name: string; success: boolean; message: string }[]; } +const MODEL_OPTIONS: { value: LlmModel; label: string }[] = [ + { value: "claude-opus", label: "Claude Opus" }, + { value: "claude-sonnet", label: "Claude Sonnet" }, + { value: "groq", label: "Groq Kimi" }, +]; + export function CliInput({ fileId, onUpdate }: CliInputProps) { const [input, setInput] = useState(""); const [loading, setLoading] = useState(false); const [messages, setMessages] = useState([]); const [expanded, setExpanded] = useState(false); + const [model, setModel] = useState("claude-opus"); const inputRef = useRef(null); const messagesRef = useRef(null); @@ -47,7 +54,7 @@ export function CliInput({ fileId, onUpdate }: CliInputProps) { setLoading(true); try { - const response = await chatWithFile(fileId, userMessage); + const response = await chatWithFile(fileId, userMessage, model); // Add assistant response const assistantMsgId = (Date.now() + 1).toString(); @@ -82,7 +89,7 @@ export function CliInput({ fileId, onUpdate }: CliInputProps) { inputRef.current?.focus(); } }, - [input, loading, fileId, onUpdate] + [input, loading, fileId, model, onUpdate] ); const clearMessages = useCallback(() => { @@ -136,7 +143,19 @@ export function CliInput({ fileId, onUpdate }: CliInputProps) { {/* Input Bar */}
- $ + + >