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

Vertex AI [Feature] support Part.from_uri for non-image files #159

Open
stevenaldinger opened this issue Apr 14, 2024 · 1 comment
Open

Comments

@stevenaldinger
Copy link

stevenaldinger commented Apr 14, 2024

I'm happy to contribute to the repo btw after getting validation that this makes sense as a feature.

I want to be able to upload text files once and be able to reference them.

Part.from_uri is only referenced in image utils here: libs/vertexai/langchain_google_vertexai/_image_utils.py#L80-L97

but in the vertexai module, that supports arbitrary mime types like the following example.

import vertexai
from vertexai.generative_models import GenerativeModel, Part

gemini_model = GenerativeModel(model_name="gemini-1.5-pro-preview-0409")

model_response = gemini_model.generate_content([
   "summarize the readme",
   Part.from_uri("gs://example-bucket/some-directory/README.md", "text/markdown"),
])

print(model_response)
@lkuligin
Copy link
Collaborator

sure, please, feel free to contribute. that would be a great addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants