diff --git a/js/packages/teams-ai/src/planners/AssistantsPlanner.spec.ts b/js/packages/teams-ai/src/planners/AssistantsPlanner.spec.ts index 40a116844..10b47ed1a 100644 --- a/js/packages/teams-ai/src/planners/AssistantsPlanner.spec.ts +++ b/js/packages/teams-ai/src/planners/AssistantsPlanner.spec.ts @@ -53,7 +53,8 @@ describe('AssistantsPlanner', () => { const options: AssistantsPlannerOptions = { apiKey: 'test-key', - assistant_id: 'test-assistant-id' + assistant_id: 'test-assistant-id', + api_version: '2024-02-15' }; planner = new AssistantsPlanner(options); diff --git a/js/packages/teams-ai/src/planners/AssistantsPlanner.ts b/js/packages/teams-ai/src/planners/AssistantsPlanner.ts index b6e4e5dd5..4ca211e87 100644 --- a/js/packages/teams-ai/src/planners/AssistantsPlanner.ts +++ b/js/packages/teams-ai/src/planners/AssistantsPlanner.ts @@ -68,6 +68,11 @@ export interface AssistantsPlannerOptions { * Defaults to 'conversation.assistants_state'. */ assistants_state_variable?: string; + + /** + * Optional. Version of the API being called. Default is '2024-02-15-preview'. + */ + api_version?: string; } /** @@ -92,6 +97,7 @@ export class AssistantsPlanner implements this._options = { polling_interval: DEFAULT_POLLING_INTERVAL, assistants_state_variable: DEFAULT_ASSISTANTS_STATE_VARIABLE, + api_version: '2024-02-15-preview', ...options }; diff --git a/js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts b/js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts index b5c3907ba..71bd1bf42 100644 --- a/js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts +++ b/js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts @@ -40,7 +40,8 @@ if (!process.env.ASSISTANT_ID) { const planner = new AssistantsPlanner({ apiKey: apiKey, endpoint: endpoint, - assistant_id: process.env.ASSISTANT_ID! + assistant_id: process.env.ASSISTANT_ID!, + api_version: '2024-02-15-preview' }); // Define storage and application diff --git a/js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts b/js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts index 1121751e2..0e818c22d 100644 --- a/js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts +++ b/js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts @@ -61,7 +61,8 @@ if (!process.env.ASSISTANT_ID) { const planner = new AssistantsPlanner({ apiKey: apiKey, endpoint: endpoint, - assistant_id: process.env.ASSISTANT_ID ?? assistantId + assistant_id: process.env.ASSISTANT_ID ?? assistantId, + api_version: '2024-02-15-preview' }); // Define storage and application