REST Resource: projects.locations.instances.users.conversations.messages

Resource: Message

Message represents a Message in SecOps chat.

JSON representation
{
  "name": string,
  "input": {
    object (MessageInput)
  },
  "responses": [
    {
      object (MessageResponse)
    }
  ],
  "create_time": string,
  "feedback": {
    object (MessageFeedback)
  }
}
Fields
name

string

Identifier. Full resource name for the message. Format: projects/{project}/locations/{location}/instances/{instance}/users/{user}/conversations/{conversation}/messages/{message}

input

object (MessageInput)

Required. Wrapper for the user input for this chat message.

responses[]

object (MessageResponse)

Output only. Wrapper for the chat responses for this chat message.

create_time

string (Timestamp format)

Output only. The message creation timestamp.

Uses RFC 3339, where generated output will always be Z-normalized and uses 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted.Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

feedback

object (MessageFeedback)

Optional. Feedback for this chat message.

MessageInput

Input represents the user input of a chat message.

JSON representation
{
  "body": string,
  "action": {
    object (Action)
  },
  "context": {
    object (Context)
  }
}
Fields
body

string

Required. The main text body of the input.

action

object (Action)

Optional. The actions attached to the input. It's only populated when the message is triggered by a suggested action execution.

context

object (Context)

Optional. The context attached to the message input. The context gives information about the current state of user journey in the application hosting the chat.

Action

Action represents an action that can be performed in the host UI.

JSON representation
{
  "display_text": string,
  "action_type": enum (ActionType),
  "use_case_id": string,

  // Union field action_metadata can be only one of the following:
  "follow_up": {
    object (FollowUp)
  },
  "navigation": {
    object (Navigation)
  },
  "execution": {
    object (Execution)
  }
  // End of list of possible types for union field action_metadata.
}
Fields
display_text

string

Output only. The text that'll be displayed to the user if this is rendered in the UI as a suggested action.

action_type

enum (ActionType)

Output only. Type of action.

use_case_id

string

Output only. The use case ID of the action. It's used internally to identify in which context the action is used.

Union field action_metadata. Depending on the action type, the corresponding action metadata must be populated. action_metadata can be only one of the following:
follow_up

object (FollowUp)

Metadata for follow up action.

navigation

object (Navigation)

Metadata for navigation action.

execution

object (Execution)

Metadata for execution action.

FollowUp

FollowUp can be used to store metadata required to send a follow up message by the UI.

JSON representation
{
  "follow_up": string
}
Fields
follow_up

string

Output only. The text to use as input when generating the follow up message.

Execution

Execution can be used to store metadata required for what action the UI should execute.

JSON representation
{
  "metadata": {
    string: string,
    ...
  }
}
Fields
metadata

map (key: string, value: string)

Output only. The payload to use when executing the action.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

ActionType

Action type allows the UI to understand what operation to trigger when user clicks ona suggested action. For example: 1. For a FOLLOW_UP action type, the UI just needs to create a new message with the follow_up.follow_up string. 2. For a NAVIGATION action type, the UI should trigger a redirection to the navigation.target_url URL. 3. For a EXECUTION action type, the UI should execute a specific suggested predefined action. Action type also allows the backend to understand what suggested action triggered a new message.

Enums
ACTION_TYPE_UNSPECIFIED The action type is unspecified.
FOLLOW_UP The action is a follow up action.
NAVIGATION The action is a navigation action.
EXECUTION The action is an execution action.

Context

Context represents the state of the hosting product (application) at the time the message was created in SecOps chat.

JSON representation
{
  "uri": string,
  "additional": string,
  "body": {
    object
  }
}
Fields
uri

string

Output only. The URI of the page when the message was created.

additional

string

Output only. Additional freeform context. This can contain various type of data depending on the use case. Note: Clients are encourged to use the body field instead of this field.

body

object (Struct format)

Output only. Generic context. This can contain any type of data for the usage of the hosting app.

MessageResponse

Response represents the AI response in a chat message.

JSON representation
{
  "blocks": [
    {
      object (ResponseBlock)
    }
  ],
  "suggested_actions": [
    {
      object (Action)
    }
  ],
  "references": [
    {
      object (ResponseBlock)
    }
  ],
  "groundings": [
    string
  ]
}
Fields
blocks[]

object (ResponseBlock)

Output only. The blocks forming the main body of the response. The body is made up of one or more blocks.

suggested_actions[]

object (Action)

Output only. The suggested actions attached to the response body.

references[]

object (ResponseBlock)

Output only. The citations of the message response formed by the AI. The citations are returned as response blocks for dynamic structured results.

groundings[]

string

Optional. Google search queries used by the AI to ground the response.

ResponseBlock

ResponseBlock represents the response body in a chat message.

JSON representation
{
  "block_type": enum (BlockType),
  "content": string,
  "title": string,

  // Union field rich_content can be only one of the following:
  "html_content": {
    object (SafeHtmlProto)
  }
  // End of list of possible types for union field rich_content.
}
Fields
block_type

enum (BlockType)

Output only. Type of the response block.

content

string

Output only. The text contents of the block. This text should be formatted based on the block_type value.

title

string

Output only. The title of the block. Could be empty.

Union field rich_content. Alternative content for complex content types. The content will be parsed based on the block_type value. rich_content can be only one of the following:
html_content

object (SafeHtmlProto)

Output only. HTML content for markdown blocks.

SafeHtmlProto

IMPORTANT: It is unsafe to accept this message from an untrusted source, since it's trivial for an attacker to forge serialized messages that don't fulfill the type's safety contract -- for example, it could contain attacker controlled script. A system which receives a SafeHtmlProto implicitly trusts the producer of the SafeHtmlProto. So, it's generally safe to return this message in RPC responses, but generally unsafe to accept it in RPC requests.

JSON representation
{
  "private_do_not_access_or_else_safe_html_wrapped_value": string
}
Fields
private_do_not_access_or_else_safe_html_wrapped_value

string

IMPORTANT: Never set or read this field, even from tests, it is private. See documentation at the top of .proto file for programming language packages with which to create or read this message.

BlockType

Types of response blocks supported.

Enums
BLOCK_TYPE_UNSPECIFIED Response block type is unspecified.
TEXT The response block is plain text.
CODE The response block is code block.
HTML The response block is HTML block.

MessageFeedback

Feedback represents the feedback of a chat message.

JSON representation
{
  "type": enum (FeedbackType),
  "comment": string,
  "labels": [
    enum (FeedbackLabel)
  ]
}
Fields
type

enum (FeedbackType)

Required. The feedback type.

comment

string

Optional. The feedback comment.

labels[]

enum (FeedbackLabel)

Output only. Feedback labels.

FeedbackType

Feedback type.

Enums
FEEDBACK_TYPE_UNSPECIFIED Feedback type is unspecified.
POSITIVE Feedback type is positive.
NEGATIVE Feedback type is negative.

FeedbackLabel

Feedback labels.

Enums
FEEDBACK_LABEL_UNSPECIFIED Feedback label is unspecified.
OFFENSIVE_OR_UNSAFE The response contains offensive or unsafe content.
IRRELEVANT The response is irrelevant.
NOT_FACTUALLY_CORRECT The response contains inaccurate information.
BUG There's an issue in the response.
DESIGN_OR_FUNCTIONALITY The design or functionality can be improved.

Methods

create

CreateMessage is used to create a new message in a conversation.

delete

DeleteMessage is used to delete a message.

get

GetMessage is used to retrieve a message.

list

ListMessages is used to retrieve existing messages for a conversation.

patch

UpdateMessage is used to update an existing message.