feat: unify MCP tool execution and chat callbacks
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 2m2s
All checks were successful
Deploy to OCIWP / deploy (push) Successful in 2m2s
This commit is contained in:
@@ -75,9 +75,9 @@ public class ChatController {
|
||||
}
|
||||
}
|
||||
|
||||
String selectedModel = request.getOrDefault("model", "gemini-flash-latest").trim();
|
||||
String selectedModel = request.getOrDefault("model", "cohere/north-mini-code:free").trim();
|
||||
if (selectedModel.isEmpty()) {
|
||||
selectedModel = "gemini-flash-latest";
|
||||
selectedModel = "cohere/north-mini-code:free";
|
||||
}
|
||||
|
||||
// 1. gemini-flash-latest 선택 시 OpenRouter의 Google Gemma 4 모델로 라우팅
|
||||
@@ -93,7 +93,7 @@ public class ChatController {
|
||||
|
||||
Flux<String> responseStream = activeChatClient.prompt()
|
||||
.user(message)
|
||||
.tools((Object[]) callbacks.toArray(new ToolCallback[0])) // Spring AI 2.0 uses tools()
|
||||
.toolCallbacks(callbacks.toArray(new ToolCallback[0]))
|
||||
.options(org.springframework.ai.openai.OpenAiChatOptions.builder()
|
||||
.model(selectedModel).build())
|
||||
.stream()
|
||||
|
||||
@@ -13,8 +13,9 @@ spring:
|
||||
api-key: ${OPENROUTER_API_KEY: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}
|
||||
base-url: https://openrouter.ai/api/v1
|
||||
chat:
|
||||
completions-path: /chat/completions
|
||||
options:
|
||||
model: google/gemma-4-31b-it:free
|
||||
model: cohere/north-mini-code:free
|
||||
temperature: 0.3
|
||||
|
||||
server:
|
||||
|
||||
@@ -85,11 +85,11 @@
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<select id="model-select" class="bg-[#1e2128] text-slate-300 text-xs px-3 py-1.5 rounded-lg border border-white/10 focus:outline-none focus:border-emerald-500/50 cursor-pointer">
|
||||
<option value="inclusionai/ling-3.0-flash:free" selected>Ling 3.0 Flash ⭐ (기본 - OpenRouter)</option>
|
||||
<option value="inclusionai/ling-3.0-flash:free">Ling 3.0 Flash (무료 - 현재 제공 상태에 따라 제한될 수 있음)</option>
|
||||
<option value="openai/gpt-oss-20b:free">GPT-OSS 20B (무료 - OpenRouter)</option>
|
||||
<option value="google/gemma-4-31b-it:free">Gemma 4 31B (무료 - OpenRouter)</option>
|
||||
<option value="nvidia/nemotron-3-nano-30b-a3b:free">NVIDIA Nemotron Nano 30B (무료 - OpenRouter)</option>
|
||||
<option value="cohere/north-mini-code:free">Cohere North Mini (무료 - OpenRouter)</option>
|
||||
<option value="cohere/north-mini-code:free" selected>Cohere North Mini (기본 · 무료 - OpenRouter)</option>
|
||||
<option value="gemini-flash-latest">Gemini 1.5 Flash (직접 API - Google)</option>
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user