How to chain prompts in teams-ai version 1.0.0 (MS Teams AI Bot app)? #1322
Replies: 1 comment 6 replies
-
Hi @donatas-xyz, thank you for posting! We have indeed deprecated the Could you share your |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm raising this question here as suggested by @corinagum.
In
@microsoft/teams-ai: ^0.1.0-preview.2
I used to useAI<ApplicationTurnState>.chain(context: TurnContext, state: ApplicationTurnState, prompt?: string | PromptTemplate, options?: Partial<AIOptions<ApplicationTurnState>>): Promise<...> Chains into another prompt and executes the plan that is returned.
.Example:
However in the new
@microsoft/teams-ai: ^1.0.0
I cannot for the life of me find anything like that? The closest I've got isActionPlanner<TurnState<DefaultConversationState, DefaultUserState, DefaultTempState>>.completePrompt<string>(context: TurnContext, memory: Memory, prompt: string | PromptTemplate, validator?: PromptResponseValidator<string>): Promise<...> Completes a prompt using an optional validator.
.Example:
I've looked at all the updated examples and couldn't see anything in regards of this functionality?
I think I've managed to address all the other breaking changes but this one.
As you can see from the example below, the
generateTenancyAgreement
prompt is chained ontochat
prompt like so:general chat starts > "generate tenancy agreement" > bot requests property address following instructions inside the
chat
prompt >generateTenancyAgreement.ts
is executed followingchat
prompt logic still >await app.ai.chain(context, state, 'generateTenancyAgreement');
is used to chainsrc\prompt\generateTenancyAgreement
with it's own parameters and prompt instructions >src\prompt\generateTenancyAgreement\skprompt.txt
are being followed and expected result returned.How would you achieve the same in version 1.0.0?
EDIT: It would seem I can use
planner.completePrompt(context, state, 'generateTenancyAgreement')
instead ofchain()
. It may be that the bug #1130 was throwing me off massively in my efforts or something changed slightly since teams-ai 1.3.Additional information
.chain()
examplesrc\prompts\chat
config.json
skprompt.txt
(simplified)generateTenancyAgreement.ts
src\prompts\generateTenancyAgreement
config.json
skprompt.txt
(simplified)Beta Was this translation helpful? Give feedback.
All reactions