How to access tokens of the specific prompt

Hi guys,
I am new here,just had a doubt

This is my current code

agent = Agent(
        model=Claude(id="anthropic.claude-3-5-sonnet-20240620-v1:0"),
        storage=SqliteAgentStorage(
            table_name="agent_sessions", db_file="tmp/agent_storage.db"
        ),
        add_history_to_messages=True,
        num_history_responses=3,
        session_id=hash_string(f"{uid}{file_type}{db_path}"),
        description=prompt,
        tools=[
            SQLTools(db_url=db_path),
            CalculatorTools(
                add=True,
                subtract=True,
                multiply=True,
                divide=True,
                exponentiate=True,
                factorial=True,
                is_prime=True,
                square_root=True,
            ),
        ],
        tool_hooks=[my_tool_hook],
        
        instructions=[],
        show_tool_calls=True,
        debug_mode=True,
    )
        run_response: Iterator[RunResponse] = agent.run(query, stream=True)
        response=""
        for chunk in run_response:
            print(
                chunk.content, end="", flush=True
            )
            response += chunk.content

What I want is to get the current token and time this prompt

I found that

    token_usage = {
        "input_tokens": agent.session_metrics.input_tokens,
        "output_tokens": agent.session_metrics.output_tokens,
        "total_tokens": agent.session_metrics.total_tokens,
    }

This works for the whole session but I need value for this prompt alone.
And is there any good ai like chatgpt,claude…
that know agno very well,most doesn’t know the context very well

Hey @iamfoss
thanks for reaching out and supporting Agno. I’ve shared this with the team, we’re working through all requests one by one and will get back to you soon.
If it’s urgent, please let us know. We appreciate your patience!

Hi @iamfoss There is a way to get run response metrics. You can refer too this documentation for the same Agent Metrics - Agno.
You can provide the agno documentation link to claude or chatgpt and that can give them the context needed . Thanks

1 Like

Thanks very much I didn’t look into Miscellaneous,Thanks anyway
Cheers