Skip to content

Commit

Permalink
Fix JS AssistantsPlannerOptions missing api version
Browse files Browse the repository at this point in the history
  • Loading branch information
Corina Gum committed Dec 12, 2024
1 parent de922ac commit d2ca0a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/packages/teams-ai/src/planners/AssistantsPlanner.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TurnState>(options);
Expand Down
6 changes: 6 additions & 0 deletions js/packages/teams-ai/src/planners/AssistantsPlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand All @@ -92,6 +97,7 @@ export class AssistantsPlanner<TState extends TurnState = TurnState> implements
this._options = {
polling_interval: DEFAULT_POLLING_INTERVAL,
assistants_state_variable: DEFAULT_ASSISTANTS_STATE_VARIABLE,
api_version: '2024-02-15-preview',
...options
};

Expand Down
3 changes: 2 additions & 1 deletion js/samples/04.ai-apps/d.assistants-mathBot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion js/samples/04.ai-apps/e.assistants-orderBot/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2ca0a7

Please sign in to comment.