OpenAIEndpoint
Wisej.AI.Endpoints.OpenAIEndpoint
Last updated
Wisej.AI.Endpoints.OpenAIEndpoint
Last updated
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI (3.5.0.0)
Represents an endpoint for connecting to OpenAI services.
This class is used to interact with OpenAI's API, providing methods to send requests and process responses for both chat completions and embeddings.
Initializes a new instance of the class with default settings.
The default authentication is set to "Bearer".
Adds options to the message for the API request.
message
The message to be sent to the API.
session
The current session context.
Builds the payload for an embeddings request.
inputs
The input strings to be embedded.
Throws:
Builds the message payload for the API request.
message
The message object containing the content to be sent.
Throws:
Constructs the API URL for chat completions.
Constructs the API URL for embeddings.
Reads the embeddings from the API response.
response
The response received from the API.
Throws:
Represents a connection to Cerebras endpoints, inheriting from OpenAIEndpoint.
Represents a connection to DeepSeek endpoints, inheriting from OpenAIEndpoint.
https://console.groq.com/docs/openai
Represents a connection to HuggingFace serverless endpoints for model inference and embeddings.
Represents a connection to LocalAI endpoints, providing access to various AI models and services.
Represents a connection to NVIDIA AI endpoints, providing access to various AI models and services.
Represents a connection to SambaNova endpoints, inheriting from OpenAIEndpoint.
Represents a connection to TogetherAI endpoints, providing access to various AI models and services.
Represents a connection to X.AI endpoints, extending the functionality of OpenAIEndpoint.
: Gets or sets the model used for embeddings. (Default: "text-embedding-3-small"
)
: Gets or sets the model used for chat completions. (Default: "gpt-4o"
)
: Gets or sets the base URL for the OpenAI API. (Default: "https://api.openai.com/v1"
)
: (Default: True
)
Sets the temperature to 0.0 and max tokens to the value of .
Returns: . The constructed payload for the embeddings request.
Thrown when the inputs are null.
Returns: . The constructed message payload.
Thrown when the message is null.
Returns: . The full API URL for chat completions.
Returns: . The full API URL for embeddings.
Returns: . An array of float arrays representing the embeddings.
Thrown when the response is null.