Skip to content

How to use api_transport "REST"? in Agent #1

@natarajan0007

Description

@natarajan0007

When authenticating with the Vertex AI API, I typically use api_transport = "rest", which works well with libraries like LangChain or the Vertex AI SDK. However, in my current enterprise environment, gRPC is blocked due to SSL-related issues. I'm now looking for a way to explicitly use REST as the transport method to interact with the Vertex AI API.

I couldn't find anything in the docs. could you please share it.

This is great stuff from google !.

Ex:
from langchain_google_vertexai import ChatVertexAI

llm = ChatVertexAI(
model_name=MODEL_NAME,
project=VERTEX_PROJECT_ID,
location=VERTEX_LOCATION,
temperature=0.0, # Low temp for predictable SQL generation/tool use
# streaming=True, # Enable streaming from the LLM if desired (handled by graph.stream later)
api_transport="rest", # Often default, explicitly set if needed
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions