Class OpenAIConfiguration
Represents the configuration for interacting with OpenAI API. Implements the IInferenceBackend interface to provide chat responses from OpenAI.
Inheritance
System.Object
OpenAIConfiguration
Implements
Namespace: Syncfusion.Blazor.SmartComponents
Assembly: Syncfusion.Blazor.SmartComponents.dll
Syntax
public class OpenAIConfiguration : Object, IInferenceBackend
Constructors
OpenAIConfiguration(IServiceProvider)
Initializes a new instance of the OpenAIConfiguration class.
Sets up the
Declaration
public OpenAIConfiguration(IServiceProvider services)
Parameters
Type | Name | Description |
---|---|---|
System.IServiceProvider | services |
Methods
GetChatResponseAsync(ChatParameters)
Retrieves the chat response from the AI service based on the provided parameters. Sends a request to the AI service and processes the response.
Declaration
public Task<string> GetChatResponseAsync(ChatParameters options)
Parameters
Type | Name | Description |
---|---|---|
ChatParameters | options | The ChatParameters containing the chat request details such as messages and other options. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | A task that represents the asynchronous operation. The task result is a string containing the AI response. |