TreeAgent Interface
An agent that can analyze and edit a SharedTree.
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 TreeAgent
Remarks
Created via createTreeAgent(model, tree, options).
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| dispose() | Alpha | void | Unsubscribes from tree change events and releases resources held by the agent. |
| message(prompt) | Alpha | Promise<string> | Process the user's prompt, potentially editing the tree in a multi-turn conversation, and return a response. |
Method Details
dispose
Unsubscribes from tree change events and releases resources held by the agent.
This API is provided as an alpha preview and may change without notice.
For more information about our API support guarantees, see here.
Signature
dispose(): void;
Remarks
After calling this method, the agent should not be used again.
message
Process the user's prompt, potentially editing the tree in a multi-turn conversation, and return a response.
This API is provided as an alpha preview and may change without notice.
For more information about our API support guarantees, see here.
Signature
message(prompt: string): Promise<string>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| prompt | string | The user's question or edit instruction. |
Returns
The model's text response.
Return type: Promise<string>