crewAIInc / 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
18.54k stars 2.55k forks source link

ModuleNotFoundError: No module named 'ollama' #805

Open lusabo opened 2 months ago

lusabo commented 2 months ago

Hi guys!

My code stopped to work and now I am receiving the error:

ModuleNotFoundError: No module named 'ollama'

I am running on Google Collab and below you can see the part with problem:

import os
import json
import requests
import warnings
import openrouteservice
from crewai import Agent, Task, Crew, Process
from crewai_tools import tool, SerperDevTool, JSONSearchTool, PGSearchTool
from langchain_groq import ChatGroq
import google.generativeai as genai
...
llama3 = ChatGroq(
    api_key="<add_your_key_here>",
    model="llama3-70b-8192"
)
...
json_tool = JSONSearchTool(
    json_path='/content/hotels.json',
    config={
        "llm": {
            "provider": "ollama",
            "config": {
                "model": "llama3"
            },
        },
        "embedder": {
            "provider": "google",
            "config": {
                "model": "models/embedding-001",
                "task_type": "retrieval_document"
            }
        }
    }
)
NPriyankaDS commented 1 month ago

Hi Lusabo,

I see you are using an LLM from GROQ cloud API, so in your json_tool, llm provider should be "groq" and not "ollama". Hope this resolves your issue.

cccadet commented 1 month ago

Hi! Anyway, if you need to, you can do a pip install ollama, if you use ollama.

LaksLaksman commented 2 weeks ago

check whether the ollama library installed, if not install it. https://pypi.org/project/ollama/