fix: the search content return tuple issue (#555)

This commit is contained in:
Willem Jiang 2025-09-04 15:45:30 +08:00 committed by GitHub
parent 8f127df948
commit a41ced1345
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -53,6 +53,9 @@ def background_investigation_node(state: State, config: RunnableConfig):
searched_content = LoggedTavilySearch(
max_results=configurable.max_search_results
).invoke(query)
# check if the searched_content is a tuple, then we need to unpack it
if isinstance(searched_content, tuple):
searched_content = searched_content[0]
if isinstance(searched_content, list):
background_investigation_results = [
f"## {elem['title']}\n\n{elem['content']}" for elem in searched_content