Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class StreamAssistResponse.
Response for the AssistantService.StreamAssist method.
Generated from protobuf message google.cloud.discoveryengine.v1.StreamAssistResponse
Namespace
Google \ Cloud \ DiscoveryEngine \ V1Methods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ answer |
AssistAnswer
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 AssistAnswer.replies. Observe AssistAnswer.state to see if more parts are to be expected. While the state is |
↳ session_info |
StreamAssistResponse\SessionInfo
Session information. |
↳ assist_token |
string
A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support. |
getAnswer
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
AssistAnswer.replies.
Observe
AssistAnswer.state to
see if more parts are to be expected. While the state is IN_PROGRESS
, the
AssistAnswer.replies
field in each response will contain replies (reply fragments) to be
appended to the ones received in previous responses. AssistAnswer.name
won't be filled.
If the state is SUCCEEDED
, FAILED
or SKIPPED
, the response
is the last response and AssistAnswer.name will have a value.
Returns | |
---|---|
Type | Description |
AssistAnswer|null |
hasAnswer
clearAnswer
setAnswer
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
AssistAnswer.replies.
Observe
AssistAnswer.state to
see if more parts are to be expected. While the state is IN_PROGRESS
, the
AssistAnswer.replies
field in each response will contain replies (reply fragments) to be
appended to the ones received in previous responses. AssistAnswer.name
won't be filled.
If the state is SUCCEEDED
, FAILED
or SKIPPED
, the response
is the last response and AssistAnswer.name will have a value.
Parameter | |
---|---|
Name | Description |
var |
AssistAnswer
|
Returns | |
---|---|
Type | Description |
$this |
getSessionInfo
Session information.
Returns | |
---|---|
Type | Description |
StreamAssistResponse\SessionInfo|null |
hasSessionInfo
clearSessionInfo
setSessionInfo
Session information.
Parameter | |
---|---|
Name | Description |
var |
StreamAssistResponse\SessionInfo
|
Returns | |
---|---|
Type | Description |
$this |
getAssistToken
A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support.
Returns | |
---|---|
Type | Description |
string |
setAssistToken
A global unique ID that identifies the current pair of request and stream of responses. Used for feedback and support.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |