CallChatAsync

OpenAIWebClient.CallChatAsync method

Sends a chat instruction to the AI model using an externally managed HttpClient instance and returns response message to the given instruction.

public Task<string> CallChatAsync(string instruction)
ParameterTypeDescription
instructionStringThe instruction or message to be processed by the AI model.

Return Value

The message generated by the AI model in response to the given instruction.

Exceptions

exceptioncondition
ArgumentExceptionOpen AI chat instruction can’t be null or empty

See Also