betalgo / openai

OpenAI .NET sdk - Azure OpenAI, ChatGPT, Whisper, and DALL-E
https://betalgo.github.io/openai/
MIT License
2.84k stars 514 forks source link

Missing nuget dependence on nuget version. #604

Open carlosmixz opened 2 weeks ago

carlosmixz commented 2 weeks ago

Describe the bug When you install with nuget, the functions throw a assembly missing exception, in exception.innerException.innerException. Instaling the last version of System.ComponentModel.Annotations nuget the exception completly disappear

Your code piece


        Dim Gpt3 = New OpenAIService(New OpenAiOptions() With {
            .ApiKey = GetSetting(Application.ProductName, "Config", "APIKeyBx", "")
        })

        Dim GerarResult = Gpt3.ChatCompletion.CreateCompletion(New ChatCompletionCreateRequest() With {
            .Messages = {ChatMessage.FromUser(Prompt)},
            .Temperature = 0.7,
            .MaxTokens = 1000,
            .Model = Models.Gpt_3_5_Turbo
        })

        While Not GerarResult.IsCompleted
            EsperaMS(16)
        End While

        Try
            result = If(GerarResult.Result.Successful, GerarResult.Result.Choices(0).Message.Content, $"Erro: {If(GerarResult.Result.Error.Message, "Erro desconhecido")}")
        Catch ex As Exception
            result = "ERRO_ERRO_DESCONHECIDO_CHAT_GPT"
        End Try

Result Result completed, but with exception and "not computed yet" state

Expected behavior Expected to retuns the GPT response.

Desktop (please complete the following information):

kayhantolga commented 2 weeks ago

Did it start with 8.5.0? Were there such problems in previous versions?

carlosmixz commented 2 weeks ago

Nop, started before the 8.0.0.