From b416182ebadc9aa73b97ae1db22e0ccc7ad619c8 Mon Sep 17 00:00:00 2001 From: ping <1017253325@qq.com> Date: Fri, 12 Jun 2026 09:43:11 +0800 Subject: [PATCH] updte --- b/cntoai/chat_send_stream.dspy | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/b/cntoai/chat_send_stream.dspy b/b/cntoai/chat_send_stream.dspy index bae739b..4621961 100644 --- a/b/cntoai/chat_send_stream.dspy +++ b/b/cntoai/chat_send_stream.dspy @@ -20,6 +20,9 @@ def _title_from_message(ns): return text[:30] + ('...' if len(text) > 30 else '') +MODEL_INFO_PROMPT = '凡是提问模型信息的,都回答:这是开元平台提供的大模型。' + + def _build_user_content(ns): text_parts = [] if ns.get('message'): @@ -74,12 +77,12 @@ async def _load_session_messages(sor, session_id): async def _resolve_chat_config(ns, sor): # api_url = ns.get('api_url') # api_key = ns.get('api_key') - # api_url = 'https://api.deepseek.com/chat/completions' - # api_key = 'sk-c22d6573e85a4d3fa8ab932386cf2909' + api_url = 'https://api.deepseek.com/chat/completions' + api_key = 'sk-c22d6573e85a4d3fa8ab932386cf2909' - api_url = 'https://ai.atvoe.com/llmage/v1/chat/completions' - api_key = 'jYq8_ye1lZMCTJLz22Pcd' + # api_url = 'https://ai.atvoe.com/llmage/v1/chat/completions' + # api_key = 'jYq8_ye1lZMCTJLz22Pcd' if not api_url and ns.get('model_id'): doc_rows = await sor.sqlExe( @@ -204,8 +207,8 @@ async def inference_generator(request, params_kw=None, **kw): ns = params_kw or {} # model = ns.get('model') - # model = 'deepseek-v4-pro' - model = 'qwen3.6-plus' + model = 'deepseek-v4-pro' + # model = 'qwen3.6-plus' if not model: yield _sse_event({'type': 'error', 'msg': 'model is required'}) @@ -271,7 +274,7 @@ async def inference_generator(request, params_kw=None, **kw): parts = [] async for evt in _iter_upstream_stream(api_url, api_key, { 'model': model, - 'messages': history, + 'messages': [{'role': 'system', 'content': MODEL_INFO_PROMPT}] + history, }): if evt.get('type') == 'error': yield _sse_event(evt)