Skip to content

genai: added test for ChatGoogleGenerativeAI class transport check #831

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

imperorrp
Copy link
Contributor

PR Description

Added a test for PR #822 for parity with the VertexAI transport check test at https://github.com/imperorrp/langchain-google/blob/main/libs/vertexai/tests/integration_tests/test_chat_models.py#L788-L803

Relevant issues

#791

Type

✅ Test

Testing

image

model = ChatGoogleGenerativeAI(model=_MODEL, transport="rest")
assert model.client.transport.kind == "rest"

async def check_async_client():
Copy link
Collaborator

Choose a reason for hiding this comment

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

why should this be async function?

Copy link
Contributor Author

@imperorrp imperorrp Apr 2, 2025

Choose a reason for hiding this comment

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

model.async_client does not appear to exist if ChatGoogleGenerativeAI is called outside of an async function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if this is added before the async function:

model = ChatGoogleGenerativeAI(model=_MODEL)
print(model.async_client)
print(model.client)
assert model.async_client.transport.kind == "grpc_asyncio"

then the test results look like this:
image

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

Successfully merging this pull request may close these issues.

2 participants