AzureAIEndpoint
Wisej.AI.Endpoints.AzureAIEndpoint
Namespace: Wisej.AI.Endpoints
Assembly: Wisej.AI (3.5.0.0)
Represents an endpoint for connecting to Azure AI services, specifically designed to interact with OpenAI models.
public class AzureAIEndpoint : SmartHttpEndpoint
This class provides properties and methods to configure and interact with Azure AI endpoints, allowing for operations such as generating text completions and embeddings.
Constructors
AzureAIEndpoint()

Initializes a new instance of the AzureAIEndpoint class with default settings.
Properties
ApiVersion

String: Gets or sets the API version used for requests. (Default: "2024-02-01"
)
Authentication

String: Gets or sets the authentication method for the endpoint. (Default: "api-key"
)
EmbeddingModel

String: Gets or sets the model used for generating text embeddings. (Default: "text-embedding-3-small"
)
Model

String: Gets or sets the model used for generating text completions. (Default: "gpt-4o"
)
URL

String: Gets or sets the URL of the Azure AI endpoint. (Default: "https://YOUR_RESOURCE_NAME.openai.azure.com"
)
Methods
AddOptions(message, session)

Adds options to the message for a session.
BuildEmbeddingsPayload(inputs)

Builds the payload for an embeddings request.
Returns: Object. An object representing the payload for the embeddings request.
Throws:
ArgumentNullException Thrown when inputs is null.
GetApiURL()

Constructs the API URL for text completion requests.
Returns: String. A string representing the API URL.
GetEmbeddingsURL()

Constructs the API URL for embedding requests.
Returns: String. A string representing the embeddings API URL.
ReadAssistantMessage(response, message)

Reads the assistant's message from the response.
Throws:
ArgumentNullException Thrown when response or message is null.
ReadEmbeddingsResponse(response)

Reads the embeddings from the response.
Returns: Single[][]. A jagged array of floats representing the embeddings.
Throws:
ArgumentNullException Thrown when response is null.
ReadUsage(message, reply)

Reads the usage statistics from the reply and updates the message.
Last updated