Skip to main content

SharedTreeChatQuery Interface

A query from a user to a SharedTreeSemanticAgent.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/tree-agent/alpha.

For more information about our API support guarantees, see here.

Signature

export interface SharedTreeChatQuery

Remarks

Processing a query may involve editing the SharedTree via the provided edit(js) function.

Properties

PropertyAlertsTypeDescription
textAlphastringThe user's query.

Methods

MethodAlertsReturn TypeDescription
edit(js)AlphaPromise<EditResult>Edit the tree with the provided JavaScript function code.

Property Details

text

The user's query.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

text: string;

Type: string

Method Details

edit

Edit the tree with the provided JavaScript function code.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

edit(js: string): Promise<EditResult>;

Remarks

Attempting an edit may fail for a variety of reasons which are captured in the returned object. If an edit fails, the tree will not be modified and the model may attempt another edit if desired. When the query ends, if the last edit attempt was successful, all edits made during the query will be merged into the agent's SharedTree. Otherwise, all edits made during the query will be discarded.

Parameters

ParameterTypeDescription
jsstring

Returns

Return type: Promise<EditResult>