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

[Bug]: crawl4ai tool ollama api fails in WebSurferAgent #985

Open
ww2283 opened this issue Feb 15, 2025 · 1 comment · May be fixed by #1033
Open

[Bug]: crawl4ai tool ollama api fails in WebSurferAgent #985

ww2283 opened this issue Feb 15, 2025 · 1 comment · May be fixed by #1033
Assignees
Labels
bug Something isn't working

Comments

@ww2283
Copy link

ww2283 commented Feb 15, 2025

Describe the bug

Ollama api errors in WebSurferAgent when using crawl4ai tool; as of version 0.7.4

Steps to reproduce

please use the following code to replicate:

from autogen.agents.experimental import WebSurferAgent
from autogen.agentchat import UserProxyAgent
import autogen
import os
# import nest_asyncio

# nest_asyncio.apply()

# Configure AutoGen agents
config_list = [
    {
        "model": "gemini-1.5-flash",
        "api_key": os.environ["GEMINI_API_KEY"],
        "api_type": "google"
    },            
    {"model": "gpt-4o-mini", "api_key": os.environ["OPENAI_API_KEY"]},
    {
        "model": "llama3.1:8b-instruct-fp16-128k",
        "client_host": "http://a.remote.ollama.address:11434",
        "api_type": "ollama"
    },
    {
        "model": "qwen2.5:32b-instruct-q4_K_M",
        "client_host": "http://a.remote.ollama.address:11434",
        "api_type": "ollama"
    }
]

filter_dict = {"model": ["qwen2.5:32b-instruct-q4_K_M"]}

config_list = autogen.filter_config(config_list, filter_dict)

llm_config = {"config_list": config_list}


websurfer = WebSurferAgent(
    llm_config=llm_config,
    name="WebSurferAgent",
    web_tool="crawl4ai",
)

websurfer.run(
    message="Give ma summary of the following page: https://docs.ag2.ai/docs/home/home",
    tools=websurfer.tools,
    max_turns=2,
    user_input=False,
)

Model Used

tool enabled ollama models: llama3.1:8b-instruct-fp16 and qwen2.5:32b-instruct-q4_K_M.

Expected Behavior

No response

Screenshots and logs

user (to WebSurferAgent):

Give ma summary of the following page: https://docs.ag2.ai/docs/home/home

--------------------------------------------------------------------------------

>>>>>>>> USING AUTO REPLY...
WebSurferAgent (to user):


***** Suggested tool call (ollama_func_1340): crawl4ai *****
Arguments: 
{"instruction": "Summarize the content of this webpage.", "url": "https://docs.ag2.ai/docs/home/home"}
************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION crawl4ai...
Call ID: ollama_func_1340
Input arguments: {'instruction': 'Summarize the content of this webpage.', 'url': 'https://docs.ag2.ai/docs/home/home'}
[INIT].... → Crawl4AI 0.4.248
[FETCH]... ↓ https://docs.ag2.ai/docs/home/home... | Status: True | Time: 1.12s
[SCRAPE].. ◆ Processed https://docs.ag2.ai/docs/home/home... | Time: 16ms
12:27:31 - LiteLLM:INFO: utils.py:2784 - 
LiteLLM completion() model= qwen2.5:32b-instruct-q4_K_M; provider = ollama
INFO     [LiteLLM] 
LiteLLM completion() model= qwen2.5:32b-instruct-q4_K_M; provider = ollama

Give Feedback / Get Help: https://github.com/BerriAI/litellm/issues/new
LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.


Provider List: https://docs.litellm.ai/docs/providers

[EXTRACT]. ■ Completed for https://docs.ag2.ai/docs/home/home... | Time: 0.6216500829905272s
[COMPLETE] ● https://docs.ag2.ai/docs/home/home... | Status: True | Total: 1.76s
user (to WebSurferAgent):

***** Response from calling tool (ollama_func_1340) *****
[
    {
        "index": 0,
        "error": true,
        "tags": [
            "error"
        ],
        "content": "litellm.APIConnectionError: OllamaException - {\"error\":\"model 'qwen2.5:32b-instruct-q4_K_M' not found\"}"
    }
]
*********************************************************

--------------------------------------------------------------------------------

>>>>>>>> USING AUTO REPLY...
WebSurferAgent (to user):

I encountered an error while trying to summarize the webpage for you. Let's try a different approach or perhaps another website. If you have specific sections or details you're interested in from that page, please let me know!

Additional Information

No response

@ww2283 ww2283 added the bug Something isn't working label Feb 15, 2025
@davorrunje davorrunje added this to ag2 Feb 16, 2025
@davorrunje davorrunje moved this to Todo in ag2 Feb 16, 2025
@davorrunje
Copy link
Collaborator

@ww2283 thank you for reporting it, we'll get down to it immediately.

@rjambrecic rjambrecic moved this from Todo to In Progress in ag2 Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants