summaryrefslogtreecommitdiff
path: root/src/ollama_web/llm.py
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-06-27 14:49:12 +0900
committertanaka takashi <isazaka@gmail.com>2026-06-27 14:49:12 +0900
commitf93822cebf6258c3a31e03745183aa2c8bb56f4d (patch)
tree8edfba7593d7db039b117fc4d742fbde78b72da6 /src/ollama_web/llm.py
parentb7943a7586fbd0bb0e19aad7732c11a62f72d7c1 (diff)
マルチ言語対応。MCP設定画面の言語切り替え表示にバグあり
Diffstat (limited to 'src/ollama_web/llm.py')
-rw-r--r--src/ollama_web/llm.py16
1 files changed, 6 insertions, 10 deletions
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()