This commit is contained in:
ping 2026-06-12 09:43:11 +08:00
parent 8d1a03b7f7
commit b416182eba

View File

@ -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)