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

the tool doesn't seem to get parameters ({topic}) #12

Open
menguzat opened this issue May 19, 2024 · 1 comment
Open

the tool doesn't seem to get parameters ({topic}) #12

menguzat opened this issue May 19, 2024 · 1 comment
Assignees

Comments

@menguzat
Copy link

Hello,

This is the gist of my code:

from crewai import Agent, Task, Crew, Process
from langchain_community.llms import Ollama
import sys
import os 

from upsonic import Tiger
tools = Tiger().crewai()

llm = Ollama(model="llama3:instruct", verbose=False, base_url="http://192.168.1.65:11434")

def kickoffTheCrew(topic): 
    researcher = Agent(
        role = "Internet Research",
        goal = f"Perform research on the {topic}, and find and explore about {topic} ",
        verbose = True,
        llm=llm,
        backstory = """You are an expert Internet Researcher
        Who knows how to search the internet for detailed content on {topic}
        Include any code examples with documentation""",
        tools=tools
    )
    
        task_search = Task(
        description="""Search for all the details about the  {topic}
                    Your final answer MUST be a consolidated content that can be used for blogging
                    This content should be well organized, and should be very easy to read""",
        expected_output='A comprehensive 10000 words information about {topic}',
        max_inter=3,
        tools=tools,           
        agent=researcher)
        
            crew = Crew(
        agents=[researcher],
        tasks=[task_search],
        verbose=2,
        process=Process.sequential )
    
    result = crew.kickoff()
    return result


# n = len(sys.argv)

# if n == 2 :
#     topic = sys.argv[1]
result = kickoffTheCrew("AI Agent Tools")
print (result)

When I run this, first of all some pip installs run all the time :

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com Requirement already satisfied: telethon==1.34.0 in d:\ai\crwai\venv\lib\site-packages (1.34.0) Requirement already satisfied: rsa in d:\ai\crwai\venv\lib\site-packages (from telethon==1.34.0) (4.9) Requirement already satisfied: pyaes in d:\ai\crwai\venv\lib\site-packages (from telethon==1.34.0) (1.6.1) Requirement already satisfied: pyasn1>=0.1.3 in d:\ai\crwai\venv\lib\site-packages (from rsa->telethon==1.34.0) (0.6.0)

the same thing repeats a few times, then I get:

[8:20:06 PM] Error on upsonic_serializer while loading                 on_prem.py:128
             interpreter.python.execute
Traceback (most recent call last):
  File "D:\AI\crwai\venv\lib\site-packages\upsonic\remote\on_prem.py", line 947, in get
    response = self.decrypt(encryption_key, value, engine, try_to_extract_importable=try_to_extract_importable)
  File "D:\AI\crwai\venv\lib\site-packages\upsonic\remote\..\remote\interface.py", line 102, in decrypt
    loaded = extract(loaded["upsonic_serializer"], loaded["name"])
  File "D:\AI\crwai\venv\lib\site-packages\upsonic\remote\..\remote\interface.py", line 96, in extract
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed       
  File "D:\AI\crwai\venv\lib\site-packages\upsonic\remote\execute_upsonic.py", line 1, in <module>
    from IPython import get_ipython
ModuleNotFoundError: No module named 'IPython'

After that, the tool starts to run but:


 [DEBUG]: == Working Agent: Internet Research
 [INFO]: == Starting Task: Search for all the details about the  **{topic}**
                    Your final answer MUST be a consolidated content that can be used for blogging
                    This content should be well organized, and should be very easy to read


> Entering new CrewAgentExecutor chain...
Let's start fresh with the correct format.

Thought:
Action: search_google
Action Input: {"query": "**{topic}**" 

['https://topic.com/', 'https://topic.com/start-your-free-trial/', 'https://topic.com/about/', 'https://topic.com/50-off-annual-summer-sale/', 'https://topic.com/explore/', 'https://www.instagram.com/topic/', 'https://tureng.com/en/turkish-english/topic', 'https://www.merriam-webster.com/dictionary/topic', 'https://www.merriam-webster.com/thesaurus/topic', 'https://www.merriam-webster.com/dictionary/topic%20sentence', 'https://www.merriam-webster.com/dictionary/topic%20of%20discussion', 'https://www.merriam-webster.com/dictionary/subtopic', 'https://dictionary.cambridge.org/dictionary/english/topic', 'https://www.hottopic.com/', 'https://www.dictionary.com/browse/topic', 'https://www.youtube.com/channel/UCF3FwGnwk6iBw5s7Y6WH5Ig', 'https://www.vocabulary.com/dictionary/topic', 'https://open.spotify.com/artist/0u6GtibW46tFX7koQ6uNJZ', 'https://www.ted.com/topics', 'https://www.facebook.com/topicproductions/']

what may be the issue here?

@onuratakan onuratakan self-assigned this May 23, 2024
@onuratakan
Copy link
Member

onuratakan commented May 23, 2024

Hi, thanks for information.

Actualy the google search tool seems working as well. But the interpreting module needs IPython module to run. But your in your system its not loaded. Anyway tiger should be install auto but it seems not working as well.

So can you install IPython manual:

pip3 install IPython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants