Skip to content

Commit

Permalink
updated sample bot
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyydu committed Oct 22, 2024
1 parent c1d08be commit 4363192
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/packages/teams-ai/src/planners/ActionPlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export class ActionPlanner<TState extends TurnState = TurnState> implements Plan
logRepairs: this._options.logRepairs,
startStreamingMessage: this._options.startStreamingMessage,
endStreamHandler: this._options.endStreamHandler,
enableFeedbackLoop: this._options.enableFeedbackLoop ?? false
enableFeedbackLoop: this._options.enableFeedbackLoop
});

// Complete prompt
Expand Down
11 changes: 8 additions & 3 deletions js/samples/04.ai-apps/i.teamsChefBot-streaming/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const model = new OpenAIModel({

// Azure OpenAI Support
// azureApiKey: process.env.AZURE_OPENAI_KEY!,
// azureDefaultDeployment: 'gpt-3.5-turbo',
// azureDefaultDeployment: 'gpt-4o',
// azureEndpoint: process.env.AZURE_OPENAI_ENDPOINT!,
// azureApiVersion: '2023-03-15-preview',

Expand Down Expand Up @@ -141,8 +141,9 @@ const storage = new MemoryStorage();
const app = new Application<ApplicationTurnState>({
storage,
ai: {
planner
}
planner,
enable_feedback_loop: true,
},
});

// Register your data source with planner
Expand Down Expand Up @@ -173,6 +174,10 @@ app.ai.action(AI.FlaggedOutputActionName, async (context: TurnContext, state: Ap
return AI.StopCommandName;
});

app.feedbackLoop(async (context, state, feedbackLoopData) => {
console.log("Feedback loop triggered");
});

// Listen for incoming server requests.
server.post('/api/messages', async (req, res) => {
// Route received a request to adapter for processing
Expand Down

0 comments on commit 4363192

Please sign in to comment.