Skip to content

OpenAiService.ChatCompletion.CreateCompletion Exception: The input does not contain any JSON tokens (Root cause: HttpClient.Timeout) #226

Answered by kayhantolga
chaojian-zhang asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry. I was too busy last week and couldn't reply to any messages.

I know the library should handle HTML responses too but I don't have time for that yet. I appreciate it if you would like to send a PR fix that. Here are 2 samples if you would like to customize httpclient.

Since we both agree the main issue is not related to the library, I am going to move this thread to discussions.

If you don't agree or something else please let me know 🙏🏻

var openAI = new OpenAIService(new OpenAiOptions()
{
    //your options
},
    new HttpClient()
    {
        Timeout = TimeSpan.FromSeconds(240)
    });
    ```
    or
```serviceCollection.AddOpenAIService().ConfigureHttpClient( r=>r.Timeout = T…

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kayhantolga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #207 on April 15, 2023 16:16.