Closed vintrocode closed 2 weeks ago
Hi @vintrocode!
To get a more detailed log of what's happening under the hood, you can set the logging level to INFO
at the beginning of the script:
import logging
logging.basicConfig(level=logging.INFO)
I've just tested your code. I was getting an internal error when the SERP_API_KEY was not set. After I've set it, I was able to get the chain working:
The last lines from the output:
...
AI:
RESPONSE
--------------------
\```json
{
"action": "Final Answer",
"action_input": "President Barack Obama welcomed the five-time Stanley Cup Champion Chicago Blackhawks to the White House to honor the team and their 2013 Stanley Cup victory."
}
\```
> Finished chain.
{'role': 'assistant', 'content': 'President Barack Obama welcomed the five-time Stanley Cup Champion Chicago Blackhawks to the White House to honor the team and their 2013 Stanley Cup victory.'}
If you can't get it to work using the detailed log, do paste it here so we can have a look at it.
@drazvan I tried something like this code, but I have used ChromaDB RetrieverQA in tools. I am getting this error. (Basically I want to use it with conv chat memory.)
ERROR:nemoguardrails.actions.action_dispatcher:Error Missing some input keys: {'input'} while execution qa_chain Traceback (most recent call last): File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\nemoguardrails\actions\action_dispatcher.py", line 133, in execute_action result = await chain.arun( File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 532, in arun await self.acall( File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 302, in acall inputs = self.prep_inputs(inputs) File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 389, in prep_inputs self._validate_inputs(inputs) File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 147, in _validate_inputs raise ValueError(f"Missing some input keys: {missingkeys}") ValueError: Missing some input keys: {'input'}
@drazvan I tried something like this code, but I have used ChromaDB RetrieverQA in tools. I am getting this error. (Basically I want to use it with conv chat memory.)
ERROR:nemoguardrails.actions.action_dispatcher:Error Missing some input keys: {'input'} while execution qa_chain Traceback (most recent call last): File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\nemoguardrails\actions\action_dispatcher.py", line 133, in execute_action result = await chain.arun( File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 532, in arun await self.acall( File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 302, in acall inputs = self.prep_inputs(inputs) File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 389, in prep_inputs self._validate_inputs(inputs) File "c:\Users\ASUS\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\chains\base.py", line 147, in _validate_inputs raise ValueError(f"Missing some input keys: {missingkeys}") ValueError: Missing some input keys: {'input'}
Hi @Nabil-iium, You have to replace query with input while calling in a colang flow block like this - $answer = execute qa_chain(input=$last_user_message)
The examples show a q/a chain that finds answers over docs. I want to use an Agent Chain as described here to run google searches given a user query. However, the bot is generating "internal error" messages and I'm not sure how to get more transparency under the hood. Here's a demo script:
it seems that the colang logic correctly identifies that the
qa_chain
needs to be called, but after two turns it generates an "internal error"...Are agents just not supported yet or is there something I can do to improve my outcomes here? Thanks