summaryrefslogtreecommitdiff
path: root/src/ollama_web/prompts
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-02 15:50:41 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-02 15:50:41 +0900
commit515f96a7779f117a7e37f854de2ded99160d0c76 (patch)
treeb63e4b39da1f7edb18146e94b16a76d4925948a4 /src/ollama_web/prompts
parent1729e1c399a41b4128b5dd7ef0286fae128e6157 (diff)
scrape_url / pdf_to_text / search_and_fetch はページング(継続トークン方式)に対応
mypy 6エラー修正
Diffstat (limited to 'src/ollama_web/prompts')
-rw-r--r--src/ollama_web/prompts/__init__.py6
-rw-r--r--src/ollama_web/prompts/en.json4
-rw-r--r--src/ollama_web/prompts/ja.json4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/ollama_web/prompts/__init__.py b/src/ollama_web/prompts/__init__.py
index 59bdb48..5b6b53e 100644
--- a/src/ollama_web/prompts/__init__.py
+++ b/src/ollama_web/prompts/__init__.py
@@ -9,7 +9,7 @@ from __future__ import annotations
import json
from pathlib import Path
-from typing import Any
+from typing import Any, cast
from ollama_web.config import settings
@@ -23,7 +23,7 @@ def _load_prompts(lang: str) -> dict[str, Any]:
path = _DIR / f"{lang}.json"
try:
with path.open("r", encoding="utf-8") as f:
- return json.load(f)
+ return cast(dict[str, Any], json.load(f))
except (FileNotFoundError, json.JSONDecodeError):
return {}
@@ -54,4 +54,4 @@ def get_prompt(key: str, lang: str | None = None, fallback: str | None = None) -
current = current[part]
if isinstance(current, str):
return current
- return fallback if fallback is not None else key
+ return fallback if fallback is not None else key \ No newline at end of file
diff --git a/src/ollama_web/prompts/en.json b/src/ollama_web/prompts/en.json
index 72a0b20..42e2e68 100644
--- a/src/ollama_web/prompts/en.json
+++ b/src/ollama_web/prompts/en.json
@@ -1,5 +1,5 @@
{
- "tool_system": "You can use web search, scraping, and file fetch tools. Do not run more searches than necessary in a single response; review the results before conducting the next investigation. Tool results are summarized, so grasp the important points and use them effectively.",
+ "tool_system": "You can use web search, scraping, and file fetch tools. Do not run more searches than necessary in a single response; review the results before conducting the next investigation. Tool results are summarized, so grasp the important points and use them effectively. If a tool result is truncated, you can fetch the continuation using the next_token at the end of the result. Pass the next_token value verbatim to the continue_from parameter. Omit continue_from when no continuation is needed.",
"current_time": "Current time: {time}",
"tool_limit_instruction": "The tool call limit has been reached. Based on the search results and conversation so far, please summarize the final answer the user requested.",
"attachment_prefix": "The following is the content of files attached by the user:",
@@ -16,4 +16,4 @@
"empty_query": "Empty query.",
"invalid_type": "Invalid file type."
}
-}
+} \ No newline at end of file
diff --git a/src/ollama_web/prompts/ja.json b/src/ollama_web/prompts/ja.json
index 00698c2..88af710 100644
--- a/src/ollama_web/prompts/ja.json
+++ b/src/ollama_web/prompts/ja.json
@@ -1,5 +1,5 @@
{
- "tool_system": "あなたはWeb検索・スクレイピング・ファイル取得ツールを利用できます。一度の回答で必要以上に多くの検索を同時に行わず、結果を確認してから次の調査を行ってください。各ツール結果は要約されて提供されるため、重要なポイントを把握して活用してください。",
+ "tool_system": "あなたはWeb検索・スクレイピング・ファイル取得ツールを利用できます。一度の回答で必要以上に多くの検索を同時に行わず、結果を確認してから次の調査を行ってください。各ツール結果は要約されて提供されるため、重要なポイントを把握して活用してください。ツール結果が途切れている場合、結果末尾の next_token を使って続きを取得できます。next_token の値は解釈せず、そのまま continue_from パラメータに渡してください。続きが必要ない場合は continue_from を省略してください。",
"current_time": "現在時刻: {time}",
"tool_limit_instruction": "ツール呼び出しの上限に達しました。これまでの検索結果と会話を元に、ユーザーが求めた回答を最終的にまとめてください。",
"attachment_prefix": "以下はユーザーが添付したファイルの内容です:",
@@ -16,4 +16,4 @@
"empty_query": "Empty query.",
"invalid_type": "Invalid file type."
}
-}
+} \ No newline at end of file