Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support passing files uploaded to Gemini Files API #2005

Open
Assignees
DouweM
Labels
@dprov

Description

@dprov

Question

I am currently using the google.genai API (and the Files API) directly and would like to switch over to Pydantic-AI, but I'd like to know if there is a way/workaround to make my use case work.

For context, I am running prompts for image analysis that include 20-30 images each (~15 image examples, ~ 5-15 images to analyze). For prompt tuning and performance testing, I run batches of e.g. 1000 test cases repeatedly. This causes the following issues:

  • Uploading images takes a significant amount of time, slowing down experiments
  • Image examples would get uploaded repeatedly (I could cache the prompt, but see below)
  • The doc states the file API should be used if the total prompt size is over 20mb (seehttps://ai.google.dev/gemini-api/docs/files)

To solve these issues, I use the Files API and manage (on my end) when to upload a file vs when to get it from cache (the File objects themselves are lightweight). I can replace all the images in my prompt with File objects, which speeds up my tests significantly, because I upload the files once, then can test multiple times during the time the files are cached.

As I understand it, the File API is not supported. Is there a way I could achieve something similar (e.g. pass the File objects somehow)?

Thanks

Additional Context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp