Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finish_reason for RunResult #509

Open
milest opened this issue Dec 20, 2024 · 1 comment
Open

finish_reason for RunResult #509

milest opened this issue Dec 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@milest
Copy link

milest commented Dec 20, 2024

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')

@samuelcolvin
Copy link
Member

I think that's a reasonable request.

@sydney-runkle sydney-runkle added the enhancement New feature or request label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants