Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 28.3 KB

File metadata and controls

18 lines (14 loc) · 28.3 KB

ChatMessageFragment

Represents a part of a ChatMessage that originates from a single action/tool. It is designed to support rich data formats beyond simple text, allowing for a more dynamic and interactive chat experience. Each fragment can include various types of content, such as text, search queries, action information, and more. Also, each ChatMessageFragment should only have one of structuredResults, querySuggestion, writeAction, followupAction, agentRecommendation, followupRoutingSuggestion or file.

Fields

Field Type Required Description Example
structured_results List[models.StructuredResult] An array of entities in the work graph retrieved via a data request.
tracking_token Optional[str] An opaque token that represents this particular result in this particular query. To be used for /feedback reporting.
text Optional[str] N/A
query_suggestion Optional[models.QuerySuggestion] N/A {
"query": "app:github type:pull author:mortimer",
"label": "Mortimer's PRs",
"datasource": "github"
}
file Optional[models.ChatFile] Structure for file uploaded by a user for Chat.
action Optional[models.ToolInfo] N/A
citation Optional[models.ChatMessageCitation] Information about the source for a ChatMessage.
server_tool_request Optional[models.ServerToolRequest] N/A
server_tool_response Optional[models.ServerToolResponse] Response to a server tool request. The applicable fields depend on requestType:

For EXECUTION requests:
- isGranted: whether tool execution is approved
- reason: optional explanation

For AUTHENTICATION_SUGGESTION requests:
- isGranted: whether auth completed successfully (true=connected, false=skipped)
- authContext: contains serverId or actionPackId for identifying the authenticated entity
- reason: optional explanation for skip

For VOTE_SUGGESTION requests:
- voted: whether the user voted for this tool