- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- AssistUserMetadata
- AgentsSpec
- AgentSpec
- ToolsSpec
- VertexAiSearchSpec
- WebGroundingSpec
- ImageGenerationSpec
- VideoGenerationSpec
- GenerationSpec
- SessionInfo
Assists the user with a query in a streaming fashion.
HTTP request
POST https://discoveryengine.googleapis.com/v1beta/{name=projects/*/locations/*/collections/*/engines/*/assistants/*}:streamAssist
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "query": { object ( |
Fields | |
---|---|
query |
Optional. Current user query. Empty query is only supported if |
session |
Optional. The session to use for the request. If specified, the assistant has access to the session history, and the query and the answer are stored there. If Format: |
userMetadata |
Optional. Information about the user initiating the query. |
agentsSpec |
Optional. Specification of agents that are used to serve the request. |
toolsSpec |
Optional. Specification of tools that are used to serve the request. |
generationSpec |
Optional. Specification of the generation configuration for the request. |
Response body
Response for the AssistantService.StreamAssist
method.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "answer": { object ( |
Fields | |
---|---|
answer |
assistants.assist answer resource object containing parts of the assistant's final answer for the user's query. Not present if the current response doesn't add anything to previously sent Observe If the state is |
sessionInfo |
Session information. |
assistToken |
A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support. |
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the name
resource:
discoveryengine.assistants.assist
For more information, see the IAM documentation.
AssistUserMetadata
User metadata of the request.
JSON representation |
---|
{ "timeZone": string, "preferredLanguageCode": string } |
Fields | |
---|---|
timeZone |
Optional. IANA time zone, e.g. Europe/Budapest. |
preferredLanguageCode |
Optional. Preferred language to be used for answering if language detection fails. Also used as the language of error messages created by actions, regardless of language detection results. |
AgentsSpec
Specification of agents that are used to serve the request.
JSON representation |
---|
{
"agentSpecs": [
{
object ( |
Fields | |
---|---|
agentSpecs[] |
Optional. Specification of agents that are used to serve the request. |
AgentSpec
Specification of an agent.
JSON representation |
---|
{ "agentId": string } |
Fields | |
---|---|
agentId |
Required. id to identify the agent resource serving the request. This field must conform to RFC-1034 with a length limit of 63 characters. |
ToolsSpec
Specification of tools that are used to serve the request.
JSON representation |
---|
{ "vertexAiSearchSpec": { object ( |
Fields | |
---|---|
vertexAiSearchSpec |
Optional. Specification of the Vertex AI Search tool. |
webGroundingSpec |
Optional. Specification of the web grounding tool. If field is present, enables grounding with web search. Works only if |
imageGenerationSpec |
Optional. Specification of the image generation tool. |
videoGenerationSpec |
Optional. Specification of the video generation tool. |
VertexAiSearchSpec
Specification of the Vertex AI Search tool.
JSON representation |
---|
{
"dataStoreSpecs": [
{
object ( |
Fields | |
---|---|
dataStoreSpecs[] |
Optional. Specs defining |
filter |
Optional. The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field 'name' in their schema. In this case the filter would look like this: filter --> name:'ANY("king kong")' For more information about filtering including syntax and filter operators, see Filter |
WebGroundingSpec
This type has no fields.
Specification of the web grounding tool.
ImageGenerationSpec
This type has no fields.
Specification of the image generation tool.
VideoGenerationSpec
This type has no fields.
Specification of the video generation tool.
GenerationSpec
Assistant generation specification for the request. This allows to override the default generation configuration at the engine level.
JSON representation |
---|
{ "modelId": string } |
Fields | |
---|---|
modelId |
Optional. The Vertex AI modelId used for the generative model. If not set, the default Assistant model will be used. |
SessionInfo
Information about the session.
JSON representation |
---|
{ "session": string } |
Fields | |
---|---|
session |
Name of the newly generated or continued session. Format: |