Skip to content

Commit 40fd822

Browse files
committed
feat(assistant-v2): MessageContextSkillSystem model added
plus, docs changes
1 parent 9ad75d7 commit 40fd822

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

assistant/v2.ts

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,20 @@ namespace AssistantV2 {
519519
export interface MessageContextSkill {
520520
/** Arbitrary variables that can be read and written by a particular skill. */
521521
user_defined?: JsonObject;
522-
/** For internal use only. */
523-
system?: JsonObject;
522+
/** System context data used by the skill. */
523+
system?: MessageContextSkillSystem;
524+
}
525+
526+
/** System context data used by the skill. */
527+
export interface MessageContextSkillSystem {
528+
/** An encoded string representing the current conversation state. By saving this value and then sending it in
529+
* the context of a subsequent message request, you can restore the conversation to the same state. This can be
530+
* useful if you need to return to an earlier point in the conversation or resume a paused conversation after the
531+
* session has expired.
532+
*/
533+
state?: string;
534+
/** MessageContextSkillSystem accepts additional properties. */
535+
[propName: string]: any;
524536
}
525537

526538
/** Information specific to particular skills used by the Assistant. **Note:** Currently, only a single property named `main skill` is supported. This object contains variables that apply to the dialog skill used by the assistant. */
@@ -551,8 +563,9 @@ namespace AssistantV2 {
551563

552564
/** Optional properties that control how the assistant responds. */
553565
export interface MessageInputOptions {
554-
/** Whether to return additional diagnostic information. Set to `true` to return additional information under
555-
* the `output.debug` key.
566+
/** Whether to return additional diagnostic information. Set to `true` to return additional information in the
567+
* `output.debug` property. If you also specify **return_context**=`true`, the returned skill context includes the
568+
* `system.state` property.
556569
*/
557570
debug?: boolean;
558571
/** Whether to restart dialog processing at the root of the dialog, regardless of any previously visited nodes.
@@ -561,10 +574,17 @@ namespace AssistantV2 {
561574
restart?: boolean;
562575
/** Whether to return more than one intent. Set to `true` to return all matching intents. */
563576
alternate_intents?: boolean;
564-
/** Whether to return session context with the response. If you specify `true`, the response will include the
565-
* `context` property.
577+
/** Whether to return session context with the response. If you specify `true`, the response includes the
578+
* `context` property. If you also specify **debug**=`true`, the returned skill context includes the `system.state`
579+
* property.
566580
*/
567581
return_context?: boolean;
582+
/** Whether to return session context, including full conversation state. If you specify `true`, the response
583+
* includes the `context` property, and the skill context includes the `system.state` property.
584+
*
585+
* **Note:** If **export**=`true`, the context is returned regardless of the value of **return_context**.
586+
*/
587+
_export?: boolean;
568588
}
569589

570590
/** Assistant output to be rendered or processed by the client. */
@@ -607,8 +627,8 @@ namespace AssistantV2 {
607627
export interface MessageResponse {
608628
/** Assistant output to be rendered or processed by the client. */
609629
output: MessageOutput;
610-
/** State information for the conversation. The context is stored by the assistant on a per-session basis. You
611-
* can use this property to access context variables.
630+
/** Context data for the conversation. The context is stored by the assistant on a per-session basis. You can
631+
* use this property to access context variables.
612632
*
613633
* **Note:** The context is included in message responses only if **return_context**=`true` in the message request.
614634
*/

0 commit comments

Comments
 (0)