-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Asynchronous I/O Conflicts? #170
Replies: 2 comments · 4 replies
-
Mind reporting an issue with a concrete example of what is going wrong? All of guidance runs async under the hood and so you should be able to just pass an async function as a command and it will work, but there might be some issue there that needs addressed. (also you should note that you can always just |
Beta Was this translation helpful? Give feedback.
All reactions
-
Working on it - thanks |
Beta Was this translation helpful? Give feedback.
All reactions
-
This same SerperSearchTool works flawlessly when run outside of Guidance (using pytest). #@title Guidance Search Tool { display-mode: "both" } import time set the default language model used to execute guidance programsguidance.llm = guidance.llms.OpenAI("gpt-3.5-turbo") instantiate a Serper Search ToolsearchTool = SerperSearchTool("search", nResults = 3) def googleSearch(query): prompt = guidance('''{{#system~}} {{#assistant~}} {{#if (is_search query)}} {{#assistant~}} {{/if}}''') query="What is Microsoft stock price at today?" Here's the output below. We can see that the "this.page" content is empty (it should have returned search results), because the I/O tasks were destroyed for some reason... ERROR:asyncio:Task was destroyed but it is pending! Error in program: "Command/variable 'this.page' not found! Please pass it when calling the program (or set a default value for it when creating the program)."KeyError Traceback (most recent call last) 25 frames KeyError: "Command/variable 'this.page' not found! Please pass it when calling the program (or set a default value for it when creating the program)." |
Beta Was this translation helpful? Give feedback.
All reactions
-
The Unit Tester calls the same SerperSearchTool and produces these results from the search. ============================= test session starts ============================== test_search.py .searchGoogle: |
Beta Was this translation helpful? Give feedback.
All reactions
-
Is there a working example that uses the "await" function I can pattern after? I'm also thinking use of aiohttp lib might be better than pycurl for this? |
Beta Was this translation helpful? Give feedback.
All reactions
-
Well, now that I have updated to 0.60 it's working fine, no async I/O conflicts are being reported and everything is working again (with caching clear working again) |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
I’m building a search tool, which works great, except now I’m trying to enhance it to go fetch the web pages from the site links returned by Google.
I have a Guidance program that’s performing search flawlessly on gpt-3.5-turbo to guide it. Until I start making my own sync or async I/O calls, which causes various problems, including guidance reporting async issues (an incompatibility).
So clearly my app needs to be aware of and compatible with Guidance’s lower level I/O paradigm while executing under a Guidance program.
Can anyone guide me to a solution for doing I/O within (called by) a Guidance program?
Beta Was this translation helpful? Give feedback.
All reactions