joaomdmoura / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
16.82k stars 2.27k forks source link

tools in crew ai #629

Open SumaiyaSultan2002 opened 1 month ago

SumaiyaSultan2002 commented 1 month ago

do tools in crew ai require open ai api key. currently i want to use groq with llama 3 model but i keep getting in error with i try to run CSVSearchTool() in the agents I encountered an error while trying to use the tool. This was the error: Error code: 401 - {'error': {'message': 'Incorrect API key provided: NA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_api_key'}}. Tool Search a CSV's content accepts these inputs: Search a CSV's content(search_query: 'string') - A tool that can be used to semantic search a query the Sample_helpdesk_tickets.csv CSV's content.

i dont want to use openai key for the tools. are there any alternatives?

SumaiyaSultan2002 commented 1 month ago

tool = CSVSearchTool( config=dict( llm=dict( provider="groq", # or google, openai, anthropic, llama2, ... config=dict( model="llama3",

temperature=0.5,

            # top_p=1,
            # stream=true,
        ),
    ),
    embedder=dict(
        provider="google", # or openai, ollama, ...
        config=dict(
            model="models/embedding-001",
            task_type="retrieval_document",
            # title="Embeddings",
        ),
    ),
)

) i also configured CSVsearchtool like this. but not sure what to do next. Would be great if someone could help me out of this.

Timilla commented 1 month ago

Hello @SumaiyaSultan2002 , I'm encountering the same issue as you when using the Groq API. Unfortunately, I believe the only way to utilize open-source LLMs while working with CrewAI is to work locally using Ollama.

TaoAthe commented 4 weeks ago

Can someone explain this in more detail? What is the workaround, if any?

gadgethome commented 4 weeks ago

Found this on crewai discord that may help

tool = JSONSearchTool( json_path=file_path, config={ "llm": { "provider": "google", "config": { "model": "gemini-pro", "temperature": 0.7, }, }, "embedder": { "provider": "google", "config": { "model": "text-embedding-004", "task_type": "retrieval_document", }, }, } )