SharedTreeChatModel Interface
A plugin interface that handles tree-agent model invocations.
To use, import via @fluidframework/tree-agent/alpha.
For more information about our API support guarantees, see here.
Signature
export interface SharedTreeChatModel
Remarks
This wraps the underlying communication with an LLM. See @fluidframework/tree-agent-langchain for a drop-in implementation based on the LangChain library.
Properties
| Property | Alerts | Modifiers | Type | Description |
|---|---|---|---|---|
| editToolName | Alpha | optional | string | The name of the tool that the model should use to edit the tree. |
| name | Alpha | optional | string | A optional name of this chat model. |
Methods
| Method | Alerts | Return Type | Description |
|---|---|---|---|
| invoke(history) | Alpha | Promise<TreeAgentChatResponse> | Invoke the model with the given message history and return a single response. |
Property Details
editToolName
The name of the tool that the model should use to edit the tree.
For more information about our API support guarantees, see here.
Signature
editToolName?: string;
Type: string
Remarks
If supplied, this is included in the generated system prompt so that the underlying LLM can request edits. The model should "implement" the tool by registering it with the underlying LLM API. The tool should accept an LLM-generated JavaScript function as input. If not supplied, the model cannot be used for semantic editing.
name
A optional name of this chat model.
For more information about our API support guarantees, see here.
Signature
name?: string;
Type: string
Remarks
If supplied, this may be used in logging or debugging information.
Example
"gpt-5"
Method Details
invoke
Invoke the model with the given message history and return a single response.
For more information about our API support guarantees, see here.
Signature
invoke(history: readonly TreeAgentChatMessage[]): Promise<TreeAgentChatResponse>;
Remarks
This is the stateless API. The model should not maintain any internal message history; all context is provided via the history parameter. Implementations should convert the TreeAgentChatMessage array to the underlying LLM's message format, invoke the LLM, and return either a TreeAgentToolCallMessage (if the model wants to call a tool) or a TreeAgentAssistantMessage (if the model is done).
Parameters
| Parameter | Type | Description |
|---|---|---|
| history | readonly TreeAgentChatMessage[] |
Returns
Return type: Promise<TreeAgentChatResponse>