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

Support prompting with media files #201

Open
longseespace opened this issue Aug 9, 2024 · 1 comment
Open

Support prompting with media files #201

longseespace opened this issue Aug 9, 2024 · 1 comment
Labels
status:wontfix This will not be worked on type:feature request New feature/request/enhancement

Comments

@longseespace
Copy link

Description of the feature request:

The Gemini API supports uploading media files separately from the prompt input, allowing your media to be reused across multiple requests and multiple prompts.

https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=python
https://ai.google.dev/api/files

What problem are you trying to solve with this feature?

Add the ability to prompt a document from a client

Any other information you'd like to share?

No response

@andrewheard
Copy link
Collaborator

Hi @longseespace, it's possible to use media files that have already been uploaded with the server-side SDKs (Python, Go, Node.js) or REST APIs using fileData in the Swift SDK, e.g.:

let content = try await model.generateContent(
  ModelContent.Part.fileData(
    mimetype: "image/jpeg",
    uri: "https://generativelanguage.googleapis.com/v1beta/files/some-hash"
  ),
  "What is in this image?"
)

Unfortunately, based on our current engineering plan and product backlog, there is no plan to support uploading files using the Swift SDK in the near term. As a potential alternative, the similar product Vertex AI for Firebase SDK supports media uploaded with the Cloud Storage for Firebase SDK. This guide shows how to use the two SDKs together: https://firebase.google.com/docs/vertex-ai/solutions/cloud-storage

@andrewheard andrewheard added status:wontfix This will not be worked on type:feature request New feature/request/enhancement labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:wontfix This will not be worked on type:feature request New feature/request/enhancement
Projects
None yet
Development

No branches or pull requests

2 participants