Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with trip_planner #136

Closed
ureshvahalia opened this issue Jul 11, 2024 · 4 comments
Closed

Problems with trip_planner #136

ureshvahalia opened this issue Jul 11, 2024 · 4 comments

Comments

@ureshvahalia
Copy link

I downloaded trip_planner and tried to make it run. It has been a struggle. Below are the main issues:
Trying to run with no modifications, I get:

Problem 1:
=======

(.venv) sh-4.4$ poetry run python main.py
E:\SoftwareDev\agents\crewAI-examples\trip_planner.venv\Lib\site-packages\langchain\llms_init_.py:548: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

from langchain_community.llms import OpenAI.

To install langchain-community run pip install -U langchain-community.
warnings.warn(

I found the OpenAI import call in trip_agents.py and incorporated the suggested revision:
from langchain_community.llms import OpenAI

and ran the program again, but got the exact same error.
By the way, after printing the error, the program freezes, and the only way to get back is to kill the terminal window. (I am running this in a VSCode terminal on Windows 11 using "sh".)

Problem 2:
=======

I worked around problem 1 by switching to Ubuntu, where I got the deprecation warning, changed over to langchain_community, and it worked. The program ran to completion using the default gpt-4, but of course cost me a few dollars. I tried to change over to gpt-3.5 by adding llm=ChatOpenAI(model_name="gpt-3.5-turbo-0125"), importing ChatOpenAI from langchain_openai. Now I tried to run the program, but get this error:

Entering new CrewAgentExecutor chain...
Thought: Do I need to use a tool? Yes
Action: Search the internet
Action Input: Weather forecast in Tokyo in April 2025, upcoming cultural events in Tokyo in April 2025, flight costs from San Francisco to Tokyo in April 2025

It seems we encountered an unexpected error while trying to use the tool.

Do I need to use a tool? Yes
Action: Search the internet
Action Input: Weather forecast in Tokyo in April 2025, upcoming cultural events in Tokyo in April 2025, flight costs from San Francisco to Tokyo in April 2025

It seems we encountered an unexpected error while trying to use the tool.

@ureshvahalia
Copy link
Author

It seems the problem is caused by gpt-4 and gpt-3.5 passing input to search_internet() in different formats. When I replaced search_internet() with a simple call to SerperDevTool(), the problem goes away and everything works great. I am surprised this hasn't hit more people already

@chinmayajha
Copy link
Contributor

You need to share your code as well, it must be a problem with the way your prompts/tool is structured. (SerperDevTool kind of a default tool so the Crew knows how to handle it, might not be the case with your own tool)

Copy link

github-actions bot commented Sep 4, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Copy link

This issue was closed because it has been stale for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants