Skip to content

Commit

Permalink
[JS] chore: Change assistants planner scope to "preview" (#909)
Browse files Browse the repository at this point in the history
## Linked issues

closes: #906 

## Details

Exports the _AssistantsPlanner.ts_ file like this: 

```js
export * as preview from "./AssistantsPlanner.ts"
```

Samples consume it like this:

```js
import { preview } from "@microsoft/teams-ai"

const { AssistantsPlanner } = preview
```

## Attestation Checklist

- [x] My code follows the style guidelines of this project

- I have checked for/fixed spelling, linting, and other errors
- I have commented my code for clarity
- I have made corresponding changes to the documentation (we use
[TypeDoc](https://typedoc.org/) to document our code)
- My changes generate no new warnings
- I have added tests that validates my changes, and provides sufficient
test coverage. I have tested with:
  - Local testing
  - E2E testing in Teams
- New and existing unit tests pass locally with my changes
  • Loading branch information
singhk97 authored Nov 28, 2023
1 parent bddb588 commit 17702fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion js/packages/teams-ai/src/planners/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

export * from "./ActionPlanner";
export * from "./AssistantsPlanner";
export * as preview from "./AssistantsPlanner";
export * from "./LLMClient";
export * from "./Planner";
export * from "./TestPlanner";
8 changes: 3 additions & 5 deletions js/samples/06.assistants.a.mathBot/src/bot.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import {
Application,
AssistantsPlanner,
AI
} from '@microsoft/teams-ai';
import { Application, preview, AI } from '@microsoft/teams-ai';
import { MemoryStorage, TurnContext } from 'botbuilder';

if (!process.env.OPENAI_KEY) {
throw new Error('Missing environment variables - please check that OPENAI_KEY.');
}

const { AssistantsPlanner } = preview;

// Create Assistant if no ID is provided
if (!process.env.ASSISTANT_ID) {
(async () => {
Expand Down
4 changes: 3 additions & 1 deletion js/samples/06.assistants.b.orderBot/src/bot.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
Application,
AssistantsPlanner,
preview,
AI
} from '@microsoft/teams-ai';
import { CardFactory, MemoryStorage, MessageFactory, TurnContext } from 'botbuilder';
Expand All @@ -11,6 +11,8 @@ if (!process.env.OPENAI_KEY) {
throw new Error('Missing environment variables - please check that OPENAI_KEY.');
}

const { AssistantsPlanner } = preview;

// Create Assistant if no ID is provided
if (!process.env.ASSISTANT_ID) {
(async () => {
Expand Down

0 comments on commit 17702fb

Please sign in to comment.