fixed missing list input ref in query (#7375)

### What problem does this PR solve?

fixed missing list input ref in query

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
so95 2025-04-29 12:03:36 +07:00 committed by GitHub
parent 5bb1c383ac
commit c69fbca24f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,7 +51,11 @@ class KeywordExtract(Generate, ABC):
def _run(self, history, **kwargs):
query = self.get_input()
query = str(query["content"][0]) if "content" in query else ""
if hasattr(query, "to_dict") and "content" in query:
query = ", ".join(map(str, query["content"].dropna()))
else:
query = str(query)
chat_mdl = LLMBundle(self._canvas.get_tenant_id(), LLMType.CHAT, self._param.llm_id)
ans = chat_mdl.chat(self._param.get_prompt(), [{"role": "user", "content": query}],