rotemweiss57 / gpt-newspaper

GPT based autonomous agent designed to create personalized newspapers tailored to user preferences.
https://tavily.com
MIT License
1.17k stars 161 forks source link

Type error: unexpected keyword argument 'start_key' #21

Open aliasal opened 5 months ago

aliasal commented 5 months ago

Hi I installed the software in a virtual environment, python 3.11, win10, 64bit

When I click on the "produce newspaper " button nothing happens but a short "hick" of the page. The console shows the following error:

File "C:\Users\Arnd\Desktop 3\gpt-newspaper\gpt-newspaper\backend\langgraph_agent.py", line 39, in run workflow.add_conditional_edges(start_key='critique', TypeError: Graph.add_conditional_edges() got an unexpected keyword argument 'start_key'

Deleting this keyword and the next two ('condition' and 'conditional_edge_mapping') solved the problem.

You should mention to rename .env.dist to .env after the github cloning.

Thanks for this great project.

wzw773828204 commented 4 months ago

workflow.add_conditional_edges(source ='critique', path =lambda x: "accept" if x['critique'] is None else "revise", path_map ={"accept": "design", "revise": "write"})

gurhoter commented 1 month ago

workflow.add_conditional_edges(source ='critique', path =lambda x: "accept" if x['critique'] is None else "revise", path_map ={"accept": "design", "revise": "write"})

this worked for me :)

UPDATE: After checking latest documentation of langgraph API, I modified the langgraph_agent like so:

workflow.add_conditional_edges( source='critique', path=lambda x: "design" if x['critique'] is None else "write" )

hope this works for all!

danglies007 commented 1 week ago

Thanks - this worked for me :)