OpenAIChatCompletionService Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OpenAIChatCompletionService(String, OpenAIClient, ILoggerFactory) |
Create an instance of the OpenAI chat completion connector |
OpenAIChatCompletionService(String, String, String, HttpClient, ILoggerFactory) |
Create an instance of the OpenAI chat completion connector |
OpenAIChatCompletionService(String, Uri, String, String, HttpClient, ILoggerFactory) |
Create an instance of the Custom Message API OpenAI chat completion connector |
OpenAIChatCompletionService(String, OpenAIClient, ILoggerFactory)
Create an instance of the OpenAI chat completion connector
public OpenAIChatCompletionService (string modelId, OpenAI.OpenAIClient openAIClient, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService : string * OpenAI.OpenAIClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService
Public Sub New (modelId As String, openAIClient As OpenAIClient, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- modelId
- String
Model name
- openAIClient
- OpenAI.OpenAIClient
Custom OpenAI.OpenAIClient for HTTP requests.
- loggerFactory
- ILoggerFactory
The ILoggerFactory to use for logging. If null, no logging will be performed.
Applies to
OpenAIChatCompletionService(String, String, String, HttpClient, ILoggerFactory)
Create an instance of the OpenAI chat completion connector
public OpenAIChatCompletionService (string modelId, string apiKey, string? organization = default, System.Net.Http.HttpClient? httpClient = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService : string * string * string * System.Net.Http.HttpClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService
Public Sub New (modelId As String, apiKey As String, Optional organization As String = Nothing, Optional httpClient As HttpClient = Nothing, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- modelId
- String
Model name
- apiKey
- String
OpenAI API Key
- organization
- String
OpenAI Organization Id (usually optional)
- httpClient
- HttpClient
Custom HttpClient for HTTP requests.
- loggerFactory
- ILoggerFactory
The ILoggerFactory to use for logging. If null, no logging will be performed.
Applies to
OpenAIChatCompletionService(String, Uri, String, String, HttpClient, ILoggerFactory)
Create an instance of the Custom Message API OpenAI chat completion connector
public OpenAIChatCompletionService (string modelId, Uri endpoint, string? apiKey = default, string? organization = default, System.Net.Http.HttpClient? httpClient = default, Microsoft.Extensions.Logging.ILoggerFactory? loggerFactory = default);
new Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService : string * Uri * string * string * System.Net.Http.HttpClient * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.SemanticKernel.Connectors.OpenAI.OpenAIChatCompletionService
Public Sub New (modelId As String, endpoint As Uri, Optional apiKey As String = Nothing, Optional organization As String = Nothing, Optional httpClient As HttpClient = Nothing, Optional loggerFactory As ILoggerFactory = Nothing)
Parameters
- modelId
- String
Model name
- endpoint
- Uri
Custom Message API compatible endpoint
- apiKey
- String
OpenAI API Key
- organization
- String
OpenAI Organization Id (usually optional)
- httpClient
- HttpClient
Custom HttpClient for HTTP requests.
- loggerFactory
- ILoggerFactory
The ILoggerFactory to use for logging. If null, no logging will be performed.