langgraph icon indicating copy to clipboard operation
langgraph copied to clipboard

[Question] How to use OpenAIAssistantRunnable on langgraph?

Open nqthiep opened this issue 1 year ago • 1 comments

Hello,

I would like to use OpenAIAssistantRunnable with langgraph, but I faced an error.

I create an assistant as following: assistant = OpenAIAssistantRunnable.create_assistant( name=name, instructions=instructions, tools=tools, model="gpt-4-1106-preview", assistant_id="asst_kqRc9iTKmgv3j5Usr0ulcYSf", streaming=True )

After that I create an agent note: agent = RunnablePassthrough.assign( agent_outcome = assistant )

Then I use this agent on sample code of langgraph, but i faced an error as following: File "/home/thiepnq/Sample/graph.py", line 50, in execute_tools tool_to_use = {t.name: t for t in tools}[agent_action.tool] AttributeError: 'list' object has no attribute 'tool'

Could you help me to solve this issue.

nqthiep avatar Jan 13 '24 15:01 nqthiep

Hi @nqthiep , Could you share more of your code? It looks like the issue may be that the ToolExecutor node isn't being initialized correctly, but I'm not sure from what has been shared so far

hinthornw avatar Jan 22 '24 22:01 hinthornw

Closing as stale

hinthornw avatar Mar 18 '24 20:03 hinthornw