Skip to content

finish_reason for RunResult #509

@milest

Description

@milest

Is there a way to view the finish_reason for a RunResult? (eg: end_turn, max_tokens, refusal, etc.)

I'm using vertex and I thought it might be available in RunReason.usage().details, but that's actually None for me.

The reason I ask is that when I have a completion that is longer than max_tokens, I need to know that so that I can give the llm a chance to finish the completion.

I'm using pydantic-ai-slim[vertexai]==0.0.14 and VertexAIModel('gemini-1.5-flash')

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions