Calling Vertex AI ADK Agent via api

Hi team,

I tested deploying my agent to Vertex AI Agent Engine and able to query by listing/getting sessions and querying it via code. But, I also see API Urls in the Vertex Ai Agent Engine page, how to use them? Can you share an example for calling agent via API?

URls I see: https://us-central1-aiplatform.googleapis.com/v1/projects/…:query

https://us-central1-aiplatform.googleapis.com/v1/projects/…:streamQuery?alt=sse

I have a simple agent to get the weather of a city (from google doc)

I have the same question. Can somebody do it?

I am still waiting for reply. If you get to understand this, keep me posted. Thanks!

I got solution. You can use Postman to test to call the API. I have tested and it works.

Hey thanks! Can you please share an example? What url you used for postman

You can use your url:

https://us-central1-aiplatform.googleapis.com/v1/projects/bux-bi-environment/locations/us-central1/reasoningEngines/1324172639656214528:streamQuery?alt=sse

There are two steps for Postman:

Step1: Create a session

Request body: {“class_method”: “create_session”, “input”: {“user_id”: “test”},}

Step2: Stream a response to a query

Request body:

{
“class_method”: “stream_query”,
“input”: {
“user_id”: “test”,
“session_id”: “session_id which you created from step1”,
“message”: “What data do you have?”
}
}

Then you can convert the code to whatever you want to call the API.