Skip to content

System.ClientModel.ClientResultException: 'HTTP 400 (invalid_request_error: ) #30

Description

@cjkarande

I am using the following code in a .NET Standard 2.0 project within a Xamarin.Forms Solution
string _model = "gpt-3.5-turbo";
_openAI_Client = new ChatClient(model: _model, _apiKey);
ChatCompletion chatCompletion = await _openAI_Client.CompleteChatAsync(new ChatMessage[] {
new UserChatMessage("Deep Reinforcement Learning for Finance")
});

however I am receiving the following exception on the execution of CompleteChatAsync()

System.ClientModel.ClientResultException: 'HTTP 400 (invalid_request_error: )
Parameter: messages.[0].content
Invalid value for 'content': expected a string, got null.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategory: Something isn't working and appears to be a defect in the client library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions