valuecell icon indicating copy to clipboard operation
valuecell copied to clipboard

Agent running all the time without output.

Open HelsonLiang opened this issue 1 year ago • 10 comments

I start a ResearchAgent. But it run about an hour without output(Answers or Error, NO).

But my openRouter credit keeps getting deducted, the number of input tokens is growing larger and larger, and when I check the logs there’s nothing useful—just the same line over and over: HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"

Image

HelsonLiang avatar Oct 26 '25 13:10 HelsonLiang

Thanks for your patience to solve this problem.

HelsonLiang avatar Oct 26 '25 13:10 HelsonLiang

Hi, thank you for pointing this out. As far as I know, Gemini (from OpenRouter), due to some unknown reasons, doesn't handle AFC as reliably as it does on AI Studio. You could try one of two things:

  • Change the model ID to another model, such as ⁠Haiku.
  • Get a Gemini API key directly from AI Studio and pass it through ⁠GOOGLE_API_KEY. This will enforce the use of the native Gemini service instead of the OpenRouter integration for now. Do not forget to remove the model id prefix google/.

P.S. Gemini offers a free tier. Refer to Gemini Developer API Pricing for details.

vcfgv avatar Oct 26 '25 15:10 vcfgv

Thanks for your clarify. Change model ID is work. But a new bug seem occurred:

Type Error in _parse_trading_request() Location: agent.py lines 454-458 Issue: The method returns a string instead of a TradingRequest object:

response = await self.parser_agent.arun(parse_prompt)
trading_request = response.content  # Returns str, not TradingRequest
return trading_request

This causes AttributeError: 'str' object has no attribute 'agent_models' at line 864.

HelsonLiang avatar Oct 28 '25 02:10 HelsonLiang

I've encountered this before. The planner model (often OpenRouter) failed to respond with the required structured schema, which caused Agno to fail when parsing it as a TradingRequest. Sad that many models currently don't support using structured output and tool calling simultaneously. That's why we use guidance prompts to align the response, but these attempts can fail, mostly due to the model's capabilities or provider issues.

If you don't mind, please share your query and model ID configurations so I can better assist you.

vcfgv avatar Oct 28 '25 03:10 vcfgv

Thanks for your patience. Here is my models ID configurations. I just replace the Gemini 2.5 Flash with anthropic/claude-haiku-4.5. ( I don't know whether the haiku model supports agent tasks.

Image

HelsonLiang avatar Oct 28 '25 11:10 HelsonLiang

Hello, may I ask why I am unable to add stock data? Is it related to the FINNHUB_API_KEY?

Image

Lingfeng713 avatar Oct 29 '25 02:10 Lingfeng713

@HelsonLiang Thank you for your patience. We've introduced a brand new configuration system and Configuration Guide. Now you can keep SILICONFLOW_API_KEY and OPENROUTER_API_KEY and modify model configuration of agents in yaml or .env. Please feel free to ask if you have any questions.

vcfgv avatar Oct 30 '25 10:10 vcfgv

Hello, may I ask why I am unable to add stock data? Is it related to the FINNHUB_API_KEY?

Image

I have the same problem, but now I need to solve other error. :(

HelsonLiang avatar Oct 30 '25 11:10 HelsonLiang

@HelsonLiang Thank you for your patience. We've introduced a brand new configuration system and Configuration Guide. Now you can keep SILICONFLOW_API_KEY and OPENROUTER_API_KEY and modify model configuration of agents in yaml or .env. Please feel free to ask if you have any questions.

OKay~ Thanks for your clarification. I will try it later.

HelsonLiang avatar Oct 30 '25 11:10 HelsonLiang

Hello, may I ask why I am unable to add stock data? Is it related to the FINNHUB_API_KEY? Image

I have the same problem, but now I need to solve other error. :(

OK,If you solve it ,Could you share with me the solution ? Thx

Lingfeng713 avatar Oct 31 '25 08:10 Lingfeng713