Skip to content

Commit

Permalink
Merge branch 'main' into release-1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkbrnd authored Feb 12, 2025
2 parents 83bd192 + 38594b7 commit 074e6f8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion libs/agno/agno/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2375,7 +2375,11 @@ def _transfer_task_to_agent(
yield self.team_response_separator

# Give a name to the member agent
agent_name = member_agent.name.replace(" ", "_").lower() if member_agent.name else f"agent_{index}"
agent_name = member_agent.name if member_agent.name else f"agent_{index}"
# Convert non-ascii characters to ascii equivalents and ensure only alphanumeric, underscore and hyphen
agent_name = "".join(c for c in agent_name if c.isalnum() or c in "_- ").strip()
agent_name = agent_name.lower().replace(" ", "_")

if member_agent.name is None:
member_agent.name = agent_name

Expand Down
5 changes: 4 additions & 1 deletion libs/agno/agno/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def get_content_string(self) -> str:
if isinstance(self.content, str):
return self.content
if isinstance(self.content, list):
return json.dumps(self.content)
if len(self.content) > 0 and isinstance(self.content[0], dict) and "text" in self.content[0]:
return self.content[0].get("text", "")
else:
return json.dumps(self.content)
return ""

def serialize_for_model(self) -> Dict[str, Any]:
Expand Down
7 changes: 6 additions & 1 deletion libs/agno/agno/tools/firecrawl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import json
from os import getenv
from typing import Any, Dict, List, Optional

from agno.tools import Toolkit
from agno.utils.log import logger

try:
from firecrawl import FirecrawlApp
Expand All @@ -20,7 +22,10 @@ def __init__(
):
super().__init__(name="firecrawl_tools")

self.api_key: Optional[str] = api_key
self.api_key: Optional[str] = api_key or getenv("FIRECRAWL_API_KEY")
if not self.api_key:
logger.error("FIRECRAWL_API_KEY not set. Please set the FIRECRAWL_API_KEY environment variable.")

self.formats: Optional[List[str]] = formats
self.limit: int = limit
self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key)
Expand Down

0 comments on commit 074e6f8

Please sign in to comment.