OkGoDoIt / OpenAI-API-dotnet

An unofficial C#/.NET SDK for accessing the OpenAI GPT-3 API
https://www.nuget.org/packages/OpenAI/
Other
1.85k stars 428 forks source link

Big announcement: official support from Microsoft! #211

Open OkGoDoIt opened 4 months ago

OkGoDoIt commented 4 months ago

It's official! Microsoft reached out to me a month ago about transitioning this library into a new official C# OpenAI library and that's what we've been working on. Starting with v2.0.0-beta.1, the library now has full coverage and will stay fully up-to-date. More details in the blog post here: https://devblogs.microsoft.com/dotnet/openai-dotnet-library/ 🎉

There's a migration guide available at https://github.com/openai/openai-dotnet/blob/main/MigrationGuide.md as well, as the new version is a bit different.

MarkHelsinki commented 4 months ago

Sounds like you have something exciting lined up.

jakubbloksa commented 4 months ago

Are you planning to update support for the new GPT-4o model with the new version?

MarkHelsinki commented 4 months ago

Are you planning to update support for the new GPT-4o model with the new version?

Good question: I tried manually updating the list of Models today by adding:

    ```/// <summary>
    /// The latest GPT-4 Omni model with multimodal (accepting text or image inputs and outputting text), and same high intelligence as GPT-4 Turbo but more efficient—generates text 2x faster and is 50% cheaper. Additionally, GPT-4o has the best vision and performance across non-English languages of any of our models. 
    /// </summary>
    public static Model GPT4_Omni => new Model("gpt-4o-2024-05-13") { OwnedBy = "openai" };```

...but I'm not sure if it's because the files are added and maintained via NuGet, but the Model class is behaving as if it was readOnly.

Tronald commented 4 months ago

I was thinking things were abandoned and gearing up to have to convert my integrations. Thank you for speaking up. Will delay in this project. Excited to hear the news!

OkGoDoIt commented 4 months ago

To answer @jakubbloksa and @MarkHelsinki , you can always pass in the model name as a string rather than using the strongly typed models class. Just use the model name identifier string that’s in the official OpenAI API docs. There’s an implicit cast of string to Model.

For example:

var chat = api.Chat.CreateConversation();
chat.Model = "gpt-4o";
MarkHelsinki commented 4 months ago

Sounds exciting. You must be pumped 🙂 Thanks for the tip, I'll give that a go. The new model is cheaper and improved language handling. So perfect for my use case.

JulesVerny commented 4 months ago

Here is hoping that is not a force towards us to be using Microsoft's Azure OpenAI services (and costs !)

Tronald commented 3 months ago

Let's go Roger! Congrats...

https://devblogs.microsoft.com/dotnet/openai-dotnet-library/

OkGoDoIt commented 3 months ago

It's official! Microsoft reached out to me a month ago about transitioning this library into a new official C# OpenAI library and that's what we've been working on. Starting with v2.0.0-beta.1, the library now has full coverage and will stay fully up-to-date. More details in the blog post here: https://devblogs.microsoft.com/dotnet/openai-dotnet-library/ 🎉

MarkHelsinki commented 3 months ago

There was mention of a tutorial for transitioning from your gitHub version to the .NET official version. Is that coming online soon? I can see there are a few differences in variable names at least.

Tronald commented 3 months ago

@MarkHelsinki https://github.com/openai/openai-dotnet/blob/main/MigrationGuide.md

OkGoDoIt commented 3 months ago

He's a webcast we recorded where we go into more details and answer some community questions: https://www.youtube.com/live/GUV2p_9QUo8?si=R2an9f3x1kO9zzzL