From f93822cebf6258c3a31e03745183aa2c8bb56f4d Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 27 Jun 2026 14:49:12 +0900 Subject: マルチ言語対応。MCP設定画面の言語切り替え表示にバグあり MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ollama_web/llm.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/ollama_web/llm.py') diff --git a/src/ollama_web/llm.py b/src/ollama_web/llm.py index 693cfa2..80e0ba6 100644 --- a/src/ollama_web/llm.py +++ b/src/ollama_web/llm.py @@ -12,7 +12,9 @@ from ollama import Message from .config import settings +from .i18n import t from .mcp import redact_secrets +from .prompts import get_prompt from .tools.registry import ToolRegistry, default_registry # Maximum successive tool-call rounds before we force a final answer. @@ -290,15 +292,12 @@ def chat_with_tools( ) yield { "type": "status", - "message": "ツール呼び出し上限に達しました。これまでの調査結果を整理中…", + "message": t("status.tool_limit_reached"), } messages.append( Message( role="user", - content=( - "ツール呼び出しの上限に達しました。これまでの検索結果と会話を元に、" - "ユーザーが求めた回答を最終的にまとめてください。" - ), + content=get_prompt("tool_limit_instruction"), ) ) try: @@ -488,15 +487,12 @@ def stream_chat_with_tools( ) yield { "type": "status", - "message": "ツール呼び出し上限に達しました。これまでの調査結果を整理中…", + "message": t("status.tool_limit_reached"), } messages.append( Message( role="user", - content=( - "ツール呼び出しの上限に達しました。これまでの検索結果と会話を元に、" - "ユーザーが求めた回答を最終的にまとめてください。" - ), + content=get_prompt("tool_limit_instruction"), ) ) t0 = time.time() -- cgit v1.2.3