Skip to main content

GenerateTreeEditCompleted Interface

An EventFlowDebugEvent marking the completion of the flow for prompting an LLM to generate an LlmTreeEdit to the users Shared Tree based on the users initial ask. It is expected that the LLM will generate multiple of these events when it must generate multiple tree edits to satisfy the user request

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

To use, import via @fluidframework/ai-collab/alpha.

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

Signature

export interface GenerateTreeEditCompleted<TIsLlmResponseValid = boolean, TEdit = TIsLlmResponseValid extends true ? LlmTreeEdit | null : undefined> extends EventFlowDebugEvent

Extends: EventFlowDebugEvent

Type Parameters

Parameter Default Description
TIsLlmResponseValid boolean
TEdit TIsLlmResponseValid extends true ? LlmTreeEdit | null : undefined

Properties

Property Alerts Type Description
eventFlowName Alpha typeof EventFlowDebugNames.GENERATE_AND_APPLY_TREE_EDIT
eventFlowStatus Alpha "COMPLETED"
eventName Alpha "GENERATE_TREE_EDIT_COMPLETED"
isLlmResponseValid Alpha TIsLlmResponseValid

Whether the response produced by the LLM is an expected response. In the event that the LLM fails to respond in an expected way, despite the API call to the LLM itself being successful, then this fields value will be false.

For now, this case is limited to the LLM returning undefined as a response when it should have returned something. But in the future this could expand to things such as invalid json.

llmGeneratedEdit Alpha TEdit

If the isLlmResponseValid field value is true then this be one of two following values returned by the LLM: 1. An edit that can be applied to a SharedTree to further accomplish the user's goal. 2. null if the LLM decides no more edits are necessary.

If the isLlmResponseValid field is false then this field will be undefined.

Property Details

eventFlowName

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

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

Signature

eventFlowName: typeof EventFlowDebugNames.GENERATE_AND_APPLY_TREE_EDIT;

Type: typeof EventFlowDebugNames.GENERATE_AND_APPLY_TREE_EDIT

eventFlowStatus

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

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

Signature

eventFlowStatus: "COMPLETED";

Type: "COMPLETED"

eventName

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

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

Signature

eventName: "GENERATE_TREE_EDIT_COMPLETED";

Type: "GENERATE_TREE_EDIT_COMPLETED"

isLlmResponseValid

Whether the response produced by the LLM is an expected response. In the event that the LLM fails to respond in an expected way, despite the API call to the LLM itself being successful, then this fields value will be false.

For now, this case is limited to the LLM returning undefined as a response when it should have returned something. But in the future this could expand to things such as invalid json.

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

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

Signature

isLlmResponseValid: TIsLlmResponseValid;

Type: TIsLlmResponseValid

llmGeneratedEdit

If the isLlmResponseValid field value is true then this be one of two following values returned by the LLM: 1. An edit that can be applied to a SharedTree to further accomplish the user's goal. 2. null if the LLM decides no more edits are necessary.

If the isLlmResponseValid field is false then this field will be undefined.

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

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

Signature

llmGeneratedEdit: TEdit;

Type: TEdit