Tiger icon indicating copy to clipboard operation
Tiger copied to clipboard

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

Open menguzat opened this issue 9 months ago • 1 comments

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?

menguzat avatar May 19 '24 17:05 menguzat