-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Engine
Description
I tried a bunch of things and have been unable to pass custom HTTP headers to an ADK agent running in Vertex Agent Engine. Is there a documented way to allow clients calling the Vertex Agent Engine's endpoint to passthrough custom headers required by the agent?
E.g., code where I try to set the state via the state attribute while creating the session. Note that headers is stripped out and there's nothing in the invocation_context.session.state
# Create a new session
response = requests.post(
f"{BASE_URL}:query",
headers=headers(),
data=json.dumps(
{
"class_method": "async_create_session",
"input": {
"user_id": USER_ID,
"state": {
"x-foo": "foo",
},
},
}
),
)
response.raise_for_status()
session = response.json()
print(f"Created session: {session}")
session_id = session.get("session_id") or session.get("id")
# Stream a query to the agent
response = requests.post(
f"{BASE_URL}:streamQuery",
headers=headers(),
data=json.dumps(
{
"class_method": "async_stream_query",
"input": {
"user_id": USER_ID,
"session_id": session_id,
"message": "What can you do?",
},
}
),
stream=True,
)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
agent engine[Component] This issue is related to Vertex AI Agent Engine[Component] This issue is related to Vertex AI Agent Engine