fix:对齐其他语言prompt
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "maibot-dashboard",
|
"name": "maibot-dashboard",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* 修改此处的版本号后,所有展示版本的地方都会自动更新
|
* 修改此处的版本号后,所有展示版本的地方都会自动更新
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const APP_VERSION = '1.0.8'
|
export const APP_VERSION = '1.0.9'
|
||||||
export const APP_NAME = 'MaiBot Dashboard'
|
export const APP_NAME = 'MaiBot Dashboard'
|
||||||
export const APP_FULL_NAME = `${APP_NAME} v${APP_VERSION}`
|
export const APP_FULL_NAME = `${APP_NAME} v${APP_VERSION}`
|
||||||
|
|
||||||
|
|||||||
25
prompts/en-US/maisaka_timing_gate.prompt
Normal file
25
prompts/en-US/maisaka_timing_gate.prompt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Your task is to analyze the current chat rhythm and decide only whether {bot_name} should continue, wait, or pause this turn. You are responsible only for rhythm control.
|
||||||
|
|
||||||
|
[Reference]
|
||||||
|
{bot_name}'s persona: {identity}
|
||||||
|
[End Reference]
|
||||||
|
|
||||||
|
Use the reference information, current scene, and output rules to decide the rhythm. Think briefly first, then output a JSON-format tool call.
|
||||||
|
In the current scene, different people may be interacting ({bot_name} is also a participant), and users may be sending consecutive messages or talking to each other.
|
||||||
|
Your task is not to produce a visible reply, nor to directly use query tools. Decide whether the next step should be:
|
||||||
|
- continue: immediately enter the next full reasoning, information gathering, reply, and tool execution flow
|
||||||
|
{timing_gate_wait_rule}
|
||||||
|
- no_reply: do not continue speaking this turn, and wait for new messages; also use this when the user may not have finished and the speaking turn should be returned to the user
|
||||||
|
|
||||||
|
|
||||||
|
Rhythm control rules:
|
||||||
|
1. If {bot_name} has already replied, the user has not sent anything new for now, and there is no new information to gather, wait.
|
||||||
|
2. If the user has sent a new message but you judge that more follow-up messages may still be coming, wait appropriately so the user can finish.
|
||||||
|
3. First determine whether users are talking to each other or talking with {bot_name}. Do not interrupt blindly or reply to the wrong target.
|
||||||
|
4. Evaluate which messages are addressed to {bot_name}, which are exchanges between users, and which are self-talk; speak only when appropriate.
|
||||||
|
5. In specific cases, consecutive replies are allowed, such as asking a follow-up question or supplementing {bot_name}'s previous message. In those cases, call continue so the main flow can proceed.
|
||||||
|
6. If you judge that an actual reply, information query, context inspection, or further analysis is needed, do not complete it here. Call continue directly and hand the work to the main flow.
|
||||||
|
|
||||||
|
{group_chat_attention_block}
|
||||||
|
|
||||||
|
Now, first output a brief textual analysis of the current chat rhythm, then call one tool:
|
||||||
25
prompts/ja-JP/maisaka_timing_gate.prompt
Normal file
25
prompts/ja-JP/maisaka_timing_gate.prompt
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
あなたのタスクは現在のチャットのリズムを分析し、{bot_name} が次に続行するべきか、待機するべきか、またはこのターンの発言を一時停止するべきかだけを決めることです。あなたはリズム制御の判断だけを担当します。
|
||||||
|
|
||||||
|
【参考情報】
|
||||||
|
{bot_name} の人格設定:{identity}
|
||||||
|
【参考情報終了】
|
||||||
|
|
||||||
|
提供された参考情報、現在の状況、出力ルールに基づいてリズムを判断してください。まず簡潔に考え、その後 JSON 形式の tool を出力してください。
|
||||||
|
現在の場面では、複数の人がやり取りしている可能性があります({bot_name} も参加者の一人です)。ユーザーが連続してメッセージを送っていたり、ユーザー同士で会話していたりすることもあります。
|
||||||
|
あなたのタスクは、他人に見える発言を生成することでも、検索系ツールを直接使うことでもありません。現在すべきことを次から判断してください:
|
||||||
|
- continue:すぐに次の完全な思考、情報収集、返信、その他ツール実行のフローに入る
|
||||||
|
{timing_gate_wait_rule}
|
||||||
|
- no_reply:このターンでは発言を続けず、新しいメッセージを待つ。ユーザーがまだ話し終えていない可能性があり、発言権をユーザーに返すべき場面でも使う
|
||||||
|
|
||||||
|
|
||||||
|
リズム制御ルール:
|
||||||
|
1. {bot_name} がすでに返信しており、ユーザーからの新しい返信がまだなく、追加で収集すべき情報もない場合は、待機してください。
|
||||||
|
2. ユーザーの新しい発言があるものの、まだ続きの発言が送られてくる可能性があると判断した場合は、ユーザーが話し終えるまで適切に待ってください。
|
||||||
|
3. まず、ユーザー同士のやり取りなのか、{bot_name} とのやり取りなのかを評価してください。むやみに割り込んだり、返信対象を間違えたりしないでください。
|
||||||
|
4. どの発言が {bot_name} 宛てで、どれがユーザー同士の会話または独り言なのかを評価し、状況に応じて発言してください。
|
||||||
|
5. フォローアップ質問をしたい場合や、以前の発言を補足したい場合など、特定の状況では連続返信してもかまいません。その場合は continue を呼び出し、メインフローを続行させてください。
|
||||||
|
6. 実際の返信、情報検索、文脈確認、またはさらなる分析が必要だと判断した場合は、ここで完了しようとせず、直接 continue を呼び出してメインフローに渡してください。
|
||||||
|
|
||||||
|
{group_chat_attention_block}
|
||||||
|
|
||||||
|
では、まず現在のチャットリズムについて短いテキスト分析を出力し、その後ツールを一つ呼び出してください:
|
||||||
@@ -8,6 +8,7 @@ import asyncio
|
|||||||
|
|
||||||
from rich.console import RenderableType
|
from rich.console import RenderableType
|
||||||
from src.common.data_models.llm_service_data_models import LLMGenerationOptions
|
from src.common.data_models.llm_service_data_models import LLMGenerationOptions
|
||||||
|
from src.common.i18n import get_locale
|
||||||
from src.common.logger import get_logger
|
from src.common.logger import get_logger
|
||||||
from src.common.prompt_i18n import load_prompt
|
from src.common.prompt_i18n import load_prompt
|
||||||
from src.common.utils.utils_config import ChatConfigUtils
|
from src.common.utils.utils_config import ChatConfigUtils
|
||||||
@@ -402,6 +403,20 @@ class MaisakaChatLoopService:
|
|||||||
def _build_timing_gate_wait_rule(self) -> str:
|
def _build_timing_gate_wait_rule(self) -> str:
|
||||||
"""构造 Timing Gate 中 wait 工具的场景说明。"""
|
"""构造 Timing Gate 中 wait 工具的场景说明。"""
|
||||||
|
|
||||||
|
locale = get_locale()
|
||||||
|
if locale == "en-US":
|
||||||
|
if self._is_group_chat is True:
|
||||||
|
return ""
|
||||||
|
if self._is_group_chat is False:
|
||||||
|
return "- wait: wait for a fixed period, then judge again"
|
||||||
|
return "- wait: available only in private chats; if this is a group chat, do not call it"
|
||||||
|
if locale == "ja-JP":
|
||||||
|
if self._is_group_chat is True:
|
||||||
|
return ""
|
||||||
|
if self._is_group_chat is False:
|
||||||
|
return "- wait:一定時間待ってから再判断する"
|
||||||
|
return "- wait:個人チャットでのみ利用できます。現在がグループチャットなら呼び出さないでください"
|
||||||
|
|
||||||
if self._is_group_chat is True:
|
if self._is_group_chat is True:
|
||||||
return ""
|
return ""
|
||||||
if self._is_group_chat is False:
|
if self._is_group_chat is False:
|
||||||
|
|||||||
Reference in New Issue
Block a user