Closed madtank closed 5 months ago
Love the new feature!
When using web search I got this error TypeError: can only concatenate str (not "list") to str. This resolved my issue. Let me know if you know the issue, or want me to open a PR.
import ast def web_or_local(prompt: str, web_local: str) -> str: if web_local == "Web": search = SerpAPIWrapper() search_text = search.run(prompt)
search_text = ast.literal_eval(search_text) web_contect = "Here is the web search result: \n\n<search>\n\n" + '\n'.join(search_text) + "\n\n</search>\n\n" prompt = web_contect + prompt return prompt else: return prompt
Maybe it was a glitch, I tried again, and worked fine.
Love the new feature!
When using web search I got this error TypeError: can only concatenate str (not "list") to str. This resolved my issue. Let me know if you know the issue, or want me to open a PR.
import ast def web_or_local(prompt: str, web_local: str) -> str: if web_local == "Web": search = SerpAPIWrapper() search_text = search.run(prompt)
Convert search_text to a list