-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for Assistants API v2 #15
Comments
Hello, |
I see in v1.37 the following properties were added to AssistantRequestBase: Temperature, TopP and ResponseFormat so I can create an assistant and specify the new fields. Plus it's not clear how I can specify that I want to use the Assistants V2 API instead of the V1 Api - OpenAI docs indicate that this request header needs to be present: "OpenAI-Beta: assistants=v2" - you might want to make that configurable through OpenAIOptions and possibly overridable on a per-operation basis (this might unnecessary). |
Additionally I noticed that some OpenAI-supported parameters are missing from the Forge.OpenAI code in the areas of Threads and Runs: The related GetXXX and ModifyXXX need to support the new parameters. |
Hello sevzas, Thanks for the feedbacks. I see there were lots of changes again in the API documentation, I try to follow them as I have some time to do. Please be patient, I try to do my best, sometimes slower, sometimes faster, depends on my amount of works. I almost finished with the missing properties on the functions above, but some properties are requires more time to implement because of that is the first time, the server side developers sends back string or object under the same property name, which requires converters. So it is not just a "lets create a property and job done" type work. I will get back to you. |
I agree, there are many changes related to Assistants API for v2. Thank you for your hard work, Zoltan. |
Hello, |
HI Zoltan, you are doing very cool, i like your lib =) There is not "retrieval" tool, it should be "file_search" This is migration guide https://platform.openai.com/docs/assistants/migration |
I tried v1.41 ... There are build errors in my code because OpenAIService.CreateService(OpenAIOptions) has been removed. Can you put this factory method back? I don't use DI so I can't use the remaining 2 flavors of CreateService( ) I see in the code that "OpenAI-Beta: assistants=v2" appears to be the default so I understand that Forge.OpenAI supports v2 assistants API by default (which is fine for me). |
You do not have to use DI directly. Please check manual creation of the service in the Playground -> MultipleApiKeyUsage -> Program.cs, line 29 - 33. |
I managed to create an instance of OpenAIService based on Playground -> MultipleApiKeyUsage -> Program.cs, line 29 - 33. Issues I see:
|
Hello, The library basicly based on DI. The factory service which was removed was a bad conception, left behind unmanaged resource in the background and does not work properly with the given option. The new one is same, except you have a better freedom to initialize the service behavior manually. However, I can help you with an additional CreateService signature, where you can provide a method, which will accept the configuration from your side. In that case, just set necessary values to the configuration. Also you can handle the lifecycle of the internal ServiceProvider, or if your service instance is global or its liefecycle eqvivalent with your application, than you can discard it with _ IOpenAIService openAiInstanceForUserB = OpenAIService.CreateService((OpenAIOptions options) => I have update the sample code in MultipleApiKeyUsage project, please have a look. |
I switched to the new CreateService() signature that you added. Thank you. |
Hi, "CreateService(OpenAIOptions options, out ServiceProvider serviceProvider)" It will copy your settings into the internal option instance. You can discard the serviceProvider as I mentioned above, if you do not want to manage the ServiceProvider. This a convenience function, but its using reflection for the copy of properties. I have update the sample code in MultipleApiKeyUsage project, please have a look, if you are interested in it. |
This is an enhancement request.
OpenAI has overhauled the assistants Api - https://platform.openai.com/docs/changelog/released-assistants-api-updates
I'm hoping that Forge.OpenAI can be enhanced to support the new Assistants API features.
Thank You!
The text was updated successfully, but these errors were encountered: