From b47519ace0ed087efff83e360790137fec57ce47 Mon Sep 17 00:00:00 2001 From: Yash Pratap Solanky <101447028+ysolanky@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:43:24 -0500 Subject: [PATCH 1/2] reasoning-fix-ag-2692 (#2096) --- libs/agno/agno/agent/agent.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/agno/agno/agent/agent.py b/libs/agno/agno/agent/agent.py index c1a7f3b6d..fd908d450 100644 --- a/libs/agno/agno/agent/agent.py +++ b/libs/agno/agno/agent/agent.py @@ -541,8 +541,7 @@ def _run( self.run_response.content = model_response_chunk.content self.run_response.created_at = model_response_chunk.created_at yield self.create_run_response( - content=model_response_chunk.content, - created_at=model_response_chunk.created_at + content=model_response_chunk.content, created_at=model_response_chunk.created_at ) # If the model response is a tool_call_started, add the tool call to the run_response elif model_response_chunk.event == ModelResponseEvent.tool_call_started.value: @@ -2740,7 +2739,7 @@ def reason(self, run_messages: RunMessages) -> Iterator[RunResponse]: reasoning_agent_messages=[ds_reasoning_message], ) # Use Groq for reasoning - if reasoning_model.__class__.__name__ == "Groq" and "deepseek" in reasoning_model.id: + elif reasoning_model.__class__.__name__ == "Groq" and "deepseek" in reasoning_model.id: from agno.reasoning.groq import get_groq_reasoning, get_groq_reasoning_agent groq_reasoning_agent = self.reasoning_agent or get_groq_reasoning_agent( @@ -2893,7 +2892,7 @@ async def areason(self, run_messages: RunMessages) -> Any: reasoning_agent_messages=[ds_reasoning_message], ) # Use Groq for reasoning - if reasoning_model.__class__.__name__ == "Groq" and "deepseek" in reasoning_model.id: + elif reasoning_model.__class__.__name__ == "Groq" and "deepseek" in reasoning_model.id: from agno.reasoning.groq import aget_groq_reasoning, get_groq_reasoning_agent groq_reasoning_agent = self.reasoning_agent or get_groq_reasoning_agent( From d9e5e56bca5a6c6b455e6cabae0362b6c6ee2b5e Mon Sep 17 00:00:00 2001 From: Anurag Date: Wed, 12 Feb 2025 15:47:07 -0500 Subject: [PATCH 2/2] Add optional parameter to pass custom api url in firecrawl (#2097) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Add optional parameter to pass custom api url in firecrawl Fixed #2093 --- ## Type of change Please check the options that are relevant: - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Model update (Addition or modification of models) - [ ] Other (please describe): --- ## Checklist - [x] Adherence to standards: Code complies with Agno’s style guidelines and best practices. - [x] Formatting and validation: You have run `./scripts/format.sh` and `./scripts/validate.sh` to ensure code is formatted and linted. - [x] Self-review completed: A thorough review has been performed by the contributor(s). - [ ] Documentation: Docstrings and comments have been added or updated for any complex logic. - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable). - [ ] Tested in a clean environment: Changes have been tested in a clean environment to confirm expected behavior. - [ ] Tests (optional): Tests have been added or updated to cover any new or changed functionality. --- --- libs/agno/agno/tools/firecrawl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/agno/agno/tools/firecrawl.py b/libs/agno/agno/tools/firecrawl.py index b0bdae52c..5e2b4ee84 100644 --- a/libs/agno/agno/tools/firecrawl.py +++ b/libs/agno/agno/tools/firecrawl.py @@ -19,6 +19,7 @@ def __init__( limit: int = 10, scrape: bool = True, crawl: bool = False, + api_url: Optional[str] = "https://api.firecrawl.dev", ): super().__init__(name="firecrawl_tools") @@ -28,7 +29,7 @@ def __init__( self.formats: Optional[List[str]] = formats self.limit: int = limit - self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key) + self.app: FirecrawlApp = FirecrawlApp(api_key=self.api_key, api_url=api_url) # Start with scrape by default. But if crawl is set, then set scrape to False. if crawl: