Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: add support for AI assistants=v2 version API #1585

Closed
1 of 8 tasks
Tracked by #1095
xiaolang124 opened this issue Apr 30, 2024 · 15 comments · Fixed by #2193
Closed
1 of 8 tasks
Tracked by #1095

[Feat]: add support for AI assistants=v2 version API #1585

xiaolang124 opened this issue Apr 30, 2024 · 15 comments · Fixed by #2193
Assignees
Labels
enhancement New feature or request

Comments

@xiaolang124
Copy link

xiaolang124 commented Apr 30, 2024

Language

Javascript/Typescript

Version

latest

Description

It appears that users cannot change the OpenAI assistant's API version, as Teams AI is currently utilizing version 4.28.4 of the OpenAI npm package, with its assistant's API version set to v1. Will you update this OpenAI npm package to the latest version, or how can we change the assistant's API version?

image

Related bug: OfficeDev/teams-toolkit#11512

Reproduction Steps

...

Tasks

Preview Give feedback
@xiaolang124 xiaolang124 added the bug Something isn't working label Apr 30, 2024
@corinagum corinagum added the dev support Dev support tracking label May 1, 2024
@smithcal1000
Copy link

OpenAI Assistant API version is hard-coded in a few files. I am using Microsoft Visual Studio. For example, this C# file also has v1 hard-coded in the threads API endpoint -> teams-ai/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/AI/OpenAI/OpenAIClient.Thread.cs
OpenAIThreadAPIversionhardcoded

@Valentinoaa
Copy link

Hi, I´m facing the same issue, but you don´t have to change the v1 in the endpoint, just change the header, check the OpenAI documentation:
image

OpenAI Assistant API version is hard-coded in a few files. I am using Microsoft Visual Studio. For example, this C# file also has v1 hard-coded in the threads API endpoint -> teams-ai/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/AI/OpenAI/OpenAIClient.Thread.cs OpenAIThreadAPIversionhardcoded

@smithcal1000
Copy link

@Valentinoaa Thank you, but how can you change the version number in the header when using the Teams AI Library provided by Microsoft to create an AI assistant bot [Preview] Teams app in Microsoft Visual Studio or VS Code?

@Valentinoaa
Copy link

Valentinoaa commented May 11, 2024

@smithcal1000, you´re wellcome.
I´ve pulled an example from the TeamsAI repo in Python and I´ve fixed it installing the latest OpenAI version (running pip install openai=1.27.00), maybe you´ll have to modify some lines (including the dependencies). You can check how to migrate here.

@smithcal1000
Copy link

I just checked and Microsoft has not yet released the Azure.AI.OpenAI.Assistants package that supports streaming and Assistants v2. It says it will be coming soon in a future update.

@Valentinoaa
Copy link

I just checked and Microsoft has not yet released the Azure.AI.OpenAI.Assistants package that supports streaming and Assistants v2. It says it will be coming soon in a future update.

Check this example. I´m using it and it works well. You just have to migrate manually to the latest OpenAI SDK as I mentioned before.

@ahmedmahmoudR
Copy link

I just checked and Microsoft has not yet released the Azure.AI.OpenAI.Assistants package that supports streaming and Assistants v2. It says it will be coming soon in a future update.

Check this example. I´m using it and it works well. You just have to migrate manually to the latest OpenAI SDK as I mentioned before.

I tried your solution, and it works after I manually installed the latest OpenAI SDK. However, can I do the same with JS instead of Python?

@aacebo aacebo added enhancement New feature or request and removed bug Something isn't working labels Jun 13, 2024
@aacebo aacebo changed the title [Bug]: cannot use open AI assistants=v2 version API [Feat]: cannot use open AI assistants=v2 version API Jun 13, 2024
@aacebo aacebo removed the dev support Dev support tracking label Jun 13, 2024
@corinagum corinagum changed the title [Feat]: cannot use open AI assistants=v2 version API [Feat]: add support for AI assistants=v2 version API Jun 13, 2024
@stuart-pebble
Copy link

Did you manage to get this working with JavaScript?

And if so did you need to modified any code / headers etc?

@corinagum
Copy link
Collaborator

Since assistants in OpenAI are still beta, this feature request is in our backlog and not being prioritized at the moment. Please feel free to share here any code as workarounds for others to take advantage of :)

@stuart-pebble
Copy link

stuart-pebble commented Jul 23, 2024 via email

@singhk97
Copy link
Collaborator

singhk97 commented Aug 7, 2024

Python & C# have been updated to support leaving only JS that needs to be brought to parity.

singhk97 added a commit that referenced this issue Aug 8, 2024
…ions (#1913)

## Linked issues
closes: #minor

#1590, #1585 

## Details
* ~Bump `OpenAI` to 2.0.0-beta.8~
* Add `AssistantMessage` class that represents a message returned by the
OpenAI Assistant.

## 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 (updating the
doc strings in the code is sufficient)
- 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
@stuart-pebble
Copy link

Looking like good progress. Just an FYI that when using the VSCode MS Teams Toolkit, the only options when choosing "Build with Assistants API" is JavaScript and TypeScript. Looking forward to the JS updates :-)

@darcohen
Copy link

Looking like good progress. Just an FYI that when using the VSCode MS Teams Toolkit, the only options when choosing "Build with Assistants API" is JavaScript and TypeScript. Looking forward to the JS updates :-)

Seconding this - the V2 capabilities, especially File Search, are a game changer. Would love to implement through MS Teams Toolkit on JS.

@stuart-pebble
Copy link

Any progress with JS support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants