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

partner(google-vertex-ai): Add Custom User Agent to Vertex AI SDK #17043

Closed

Conversation

holtskinner
Copy link
Contributor

@holtskinner holtskinner commented Feb 5, 2024

Tested locally successfully when installing from source PR.

DO NOT MERGE - Until googleapis/python-aiplatform#3261 is Released and minimum_expected_version is updated to correct version.

- For API metrics collection
- Followup to langchain-ai#12168

NOTE: Before Merging, Update `raise_vertex_import_error(minimum_expected_version: str = "1.40.0")` to the actual version once the SDK is updated.
- https://pypi.org/project/google-cloud-aiplatform/
@efriis efriis added the partner label Feb 5, 2024
@efriis efriis self-assigned this Feb 5, 2024
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 5, 2024
Copy link

vercel bot commented Feb 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2024 11:09pm

@dosubot dosubot bot added Ɑ: embeddings Related to text embedding models module 🤖:improvement Medium size change to existing code to handle new use-cases 🔌: google Primarily related to Google GenAI or VertexAI integrations labels Feb 5, 2024
holtskinner and others added 3 commits February 5, 2024 11:15
- Remove try/except from community vertexai.py
…lt version of `0.0.0` in case of failure.

- This is needed for internal queries to work as expected.
@holtskinner holtskinner changed the title community/partners: Add Custom User Agent to Vertex AI SDK partner(google-vertex-ai): Add Custom User Agent to Vertex AI SDK Feb 5, 2024
@baskaryan
Copy link
Collaborator

cc @lkuligin

@@ -80,6 +94,9 @@ def init_vertexai(
credentials=credentials,
)

_, user_agent = _get_user_agent(module)
initializer.global_config.append_user_agent(user_agent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting mypy errors that this append_user_agent function doesn't exist on _Config. Also causes the tests to fail, so seems like a real problem even after updating packages.

@holtskinner @lkuligin let me know how's best to fix!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I'm silly - looks like it'll be in 42 when ready. Will convert this to a draft PR for now!

@efriis efriis marked this pull request as draft February 10, 2024 01:16
@efriis
Copy link
Member

efriis commented Feb 26, 2024

@lkuligin not sure if this one made it over to https://github.com/langchain-ai/langchain-google yet - should this be re-opened over there?

@efriis efriis closed this Feb 26, 2024
@holtskinner
Copy link
Contributor Author

I think that langchain-ai/langchain-google#31 covers everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ɑ: embeddings Related to text embedding models module 🔌: google Primarily related to Google GenAI or VertexAI integrations 🤖:improvement Medium size change to existing code to handle new use-cases partner size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants