Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the agent reference bug and the session prologue #3823

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions api/apps/sdk/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def create(tenant_id,chat_id):
"id": get_uuid(),
"dialog_id": req["dialog_id"],
"name": req.get("name", "New session"),
"message": [{"role": "assistant", "content": "Hi! I am your assistant,can I help you?"}]
"message": [{"role": "assistant", "content": dia[0].prompt_config.get("prologue")}]
}
if not conv.get("name"):
return get_error_data_result(message="`name` can not be empty.")
Expand Down Expand Up @@ -274,7 +274,6 @@ def agent_completion(tenant_id, agent_id):

def fillin_conv(ans):
reference = ans["reference"]
print(reference,flush=True)
temp_reference = deepcopy(ans["reference"])
nonlocal conv, message_id
if not conv.reference:
Expand All @@ -288,7 +287,7 @@ def fillin_conv(ans):
for chunk in chunks:
new_chunk = {
"id": chunk["chunk_id"],
"content": chunk["content_with_weight"],
"content": chunk["content"],
"document_id": chunk["doc_id"],
"document_name": chunk["docnm_kwd"],
"dataset_id": chunk["kb_id"],
Expand Down