Fix: add prologue to api. (#9322)

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-08-08 17:05:55 +08:00
committed by GitHub
parent cd3bb0ed7c
commit a02ca16260
4 changed files with 8 additions and 4 deletions

View File

@ -172,6 +172,7 @@ def completion(tenant_id, agent_id, session_id=None, **kwargs):
conv.message.append({"role": "assistant", "content": txt, "created_at": time.time(), "id": message_id})
conv.reference = canvas.get_reference()
conv.errors = canvas.error
conv.dsl = str(canvas)
conv = conv.to_dict()
API4ConversationService.append_message(conv["id"], conv)

View File

@ -225,10 +225,11 @@ class TenantLLMService(CommonService):
if llm_id == llm["llm_name"]:
return llm["model_type"].split(",")[-1]
for llm in TenantLLMService.query(llm_name=llm_id):
for llm in LLMService.query(llm_name=llm_id):
return llm.model_type
for llm in LLMService.query(llm_name=llm_id):
llm = TenantLLMService.get_or_none(llm_name=llm_id)
if llm:
return llm.model_type
for llm in TenantLLMService.query(llm_name=llm_id):
return llm.model_type