|
|
|
@@ -173,6 +173,19 @@ def completion(tenant_id, agent_id, question, session_id=None, stream=True, **kw |
|
|
|
conv.reference = [] |
|
|
|
conv.reference.append({"chunks": [], "doc_aggs": []}) |
|
|
|
|
|
|
|
kwargs_changed = False |
|
|
|
if kwargs: |
|
|
|
query = canvas.get_preset_param() |
|
|
|
if query: |
|
|
|
for ele in query: |
|
|
|
if ele["key"] in kwargs: |
|
|
|
if ele["value"] != kwargs[ele["key"]]: |
|
|
|
ele["value"] = kwargs[ele["key"]] |
|
|
|
kwargs_changed = True |
|
|
|
if kwargs_changed: |
|
|
|
conv.dsl = json.loads(str(canvas)) |
|
|
|
API4ConversationService.update_by_id(session_id, {"dsl": conv.dsl}) |
|
|
|
|
|
|
|
final_ans = {"reference": [], "content": ""} |
|
|
|
if stream: |
|
|
|
try: |