I am trying to create an “auto-session” id and get it back in the search/answer endpoints response so that I can pass it back in the subsequent request but I am unable to create one and keep running into 404 error. From the documentation, under the field “session”, (https://cloud.google.com/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.servingConfigs/search), I see we need to add “/sessions” in the url but it does not seem to work regardless of where I put it. For example, I see a successful response coming back when I hit the below endpoint (Marked project name and dataStore names with ** as they are internal information)
While the concept of appending sessions to the endpoint URL is a common practice in some APIs, it appears the Discovery Engine API handles session management differently.
Be guided that there is a dedicated endpoint for creating sessions. Here’s the corrected information:
You must create a session before using it in search requests.
When using an existing session, make sure to use the correct session ID in the search request.
POST Request: To create a new session, you’ll need to use a POST request to this endpoint.
Session ID: The response to your POST request will include the newly created session ID, which you can then use in subsequent requests to maintain session context.
Additional Notes:
Ensure you are using the correct authorization credentials to access the Discovery Engine API and IAM permissions to create sessions.
Consult the official Discovery Engine API documentation for more details on creating sessions and working with session-based search/answer requests.
By following these steps and ensuring the correct endpoint structure, you should be able to create sessions and retrieve session IDs for your Vertex AI search/answer endpoints.