SequenceAugmentation class
The 'sequence' augmentation.
Remarks
This augmentation allows the model to return a sequence of actions to perform.
Constructors
Sequence |
Methods
create |
Creates a plan given validated response value. |
create |
Creates an optional prompt section for the augmentation. |
validate |
Validates a response to a prompt. |
Constructor Details
SequenceAugmentation(ChatCompletionAction[])
Method Details
createPlanFromResponse(TurnContext, Memory, PromptResponse<undefined | Plan>)
Creates a plan given validated response value.
function createPlanFromResponse(context: TurnContext, memory: Memory, response: PromptResponse<undefined | Plan>): Promise<Plan>
Parameters
- context
-
TurnContext
Context for the current turn of conversation.
- memory
- Memory
An interface for accessing state variables.
- response
-
PromptResponse<undefined | Plan>
The validated and transformed response for the prompt.
Returns
Promise<Plan>
The created plan.
createPromptSection()
Creates an optional prompt section for the augmentation.
function createPromptSection(): undefined | PromptSection
Returns
undefined | PromptSection
The new PromptSection or undefined.
validateResponse(TurnContext, Memory, Tokenizer, PromptResponse<string>, number)
Validates a response to a prompt.
function validateResponse(context: TurnContext, memory: Memory, tokenizer: Tokenizer, response: PromptResponse<string>, remaining_attempts: number): Promise<Validation<undefined | Plan>>
Parameters
- context
-
TurnContext
Context for the current turn of conversation with the user.
- memory
- Memory
An interface for accessing state values.
- tokenizer
- Tokenizer
Tokenizer to use for encoding and decoding text.
- response
-
PromptResponse<string>
Response to validate.
- remaining_attempts
-
number
Number of remaining attempts to validate the response.
Returns
Promise<Validation<undefined | Plan>>
A Validation
object.