TypeError while calling langchain runnables #24383
Replies: 1 comment 5 replies
-
Hey @Tharun1718! 👋 I'm here to help you with any bugs, questions, or contributions you have in mind. If you need assistance, feel free to ask. To resolve the Here is an example of how to correctly pass the question to question_dict = {"query": "Name the agencies are present"}
result = final_chain.invoke(question_dict) Make sure that the key in the dictionary is Additionally, if you are working with a SQL chain, the input dictionary should have a key question_dict = {"question": "Name the agencies are present"}
response = final_chain.invoke(question_dict) Ensure that the key in the dictionary is |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
I am trying to pass a question to langchain runnable and I am getting the below error 68 try:
---> 69 return self._core_bpe.encode_ordinary(text)
70 except UnicodeEncodeError:
71 # See comment in encode
TypeError: argument 'text': 'dict' object cannot be converted to 'PyString'
while executing retriever_chain.invoke("question_string") then question is provided as string and it works, but while invoking final_chain and passing question as a dict ({"question":""}). I am getting the above error
System Info
Python 3.11.9
Langchain 0.2.8
Beta Was this translation helpful? Give feedback.
All reactions