SmartEndpoint
Wisej.AI.SmartEndpoint
Last updated
Wisej.AI.SmartEndpoint
Last updated
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents an abstract base class for a smart endpoint component that interacts with AI models.
This class provides properties and methods to configure and interact with AI models, including handling messages, building payloads, and managing tool invocations.
Initializes a new instance of the class.
Warning, setting this property entirely overrides the internal system prompt.
Warning, setting this property entirely overrides the internal tools prompt.
Adds messages to the payload object.
payload
The payload object to update.
session
The session context.
messages
The list of messages to add.
Throws:
Adds model options to the message object.
message
The message object to update.
session
The session context.
Throws:
Asynchronously sends a message to the AI model and returns the response.
session
The session context.
messages
The list of messages to send.
This method must be implemented by derived classes to handle the specific logic for sending messages to the AI model.
Asynchronously requests embeddings for the given inputs.
inputs
The array of input strings.
Throws:
response
The response to build from.
Throws:
Builds a payload for requesting embeddings.
inputs
The array of input strings.
Throws:
message
The message to build from.
Throws:
Builds the tools namespace prompt based on the session context.
session
The session context.
Throws:
Builds a string representation of tool parameters.
parameters
The array of parameters to build from.
session
The session context.
messages
The list of messages to include in the payload.
Throws:
Builds the messages containing tool results.
toolResults
Builds a message containing tool results.
toolResults
The array of tools with results.
Builds the tools payload based on the session context.
session
The session context.
Throws:
Builds the tools prompt based on the session context.
session
The session context.
Throws:
Gets the current language based on the session context.
session
The session context.
Gets a description of the current date.
Gets the tools to invoke based on the session and message context.
session
The session context.
message
The message context.
Throws:
Reads the assistant message from the response and updates the message object.
response
The response containing the assistant message.
message
The message object to update.
Reads the embeddings response and returns the embeddings data.
response
The response containing embeddings data.
Throws:
Reads the usage information from reply.
message
The message containing usage information.
reply
The reply object to update with usage information.
Represents an endpoint for connecting to Amazon Bedrock services.
Represents an endpoint for connecting to Anthropic services.
Represents an endpoint for connecting to Azure AI services, specifically designed to interact with OpenAI models.
Represents a connection to Cerebras endpoints, inheriting from OpenAIEndpoint.
Represents a connection to DeepSeek endpoints, inheriting from OpenAIEndpoint.
Represents a connection to Google AI endpoints for generating content and embeddings.
https://console.groq.com/docs/openai
Represents a connection to GroqCloud speech endpoints for audio transcription.
Represents a connection to HuggingFace serverless endpoints for model inference and embeddings.
Represents an endpoint that uses the transformers.js module in the user's browser to provide AI services to Wisej.AI components.
Represents a connection to LocalAI endpoints, providing access to various AI models and services.
Represents an endpoint for connecting to LocalAI Image Generation services.
Represents an endpoint for connecting to LocalAI's speech services.
Represents an endpoint for connecting to LocalAI's Whisper model for speech-to-text transcriptions.
Represents a connection to NVIDIA AI endpoints, providing access to various AI models and services.
Represents an endpoint that connects to Ollama services, providing functionalities for chat and embeddings.
Represents an endpoint for connecting to OpenAI services.
Represents an endpoint for connecting to OpenAI DallE services.
Represents a component that manages communication with OpenAI's real-time API endpoints.
Represents an endpoint for connecting to OpenAI's speech services.
Represents an endpoint for connecting to OpenAI's Whisper model for speech-to-text transcriptions.
Represents a connection to SambaNova endpoints, inheriting from OpenAIEndpoint.
Represents an abstract base class for a smart HTTP endpoint, providing common functionality for HTTP-based communication.
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 size of the context window in tokens. (Default: 32000
)
: Gets or sets the embedding model used by the endpoint. (Default: null
)
: Gets or sets the maximum number of output tokens. (Default: 4096
)
: Gets or sets the model used by the endpoint. (Default: null
)
: Gets the model options for the endpoint.
: Gets or sets the name of the endpoint.
: Gets or sets the system prompt for the endpoint.
: Gets or sets the tools prompt for the endpoint.
: Gets the usage metrics for the endpoint.
: Gets or sets a value indicating that the endpoint should use the native tools payload when adding tools to the request. (Default: False
)
Thrown when the session, payload, or messages are null.
Thrown when the message is null.
Returns: . A task representing the asynchronous operation, with a as the result.
Returns: . A task representing the asynchronous operation, with an as the result.
Thrown when the method is not implemented.
Builds an assistant from the given response.
Returns: . A representing the assistant's response.
Thrown when the response is null.
Returns: . An object representing the embeddings payload.
Thrown when the method is not implemented.
Builds a message object from the given .
Returns: . An object representing the built message.
Thrown when the message is null.
Returns: . A string representing the tools prompt.
Thrown when the session is null.
Returns: . A string representing the tool parameters.
Builds a payload object for the given and .
Returns: . An object representing the built payload.
Thrown when the session or messages are null.
Returns: . An array of representing the tool results.
Returns: . A representing the tool results.
Returns: . A JSON object representing the tools payload.
Thrown when the session is null.
Returns: . A string representing the tools prompt.
Thrown when the session is null.
Returns: . A string representing the current language.
Returns: . A string representing the current date.
Returns: . An array of representing the tools to invoke.
Thrown when the session or message is null.
The implementation of this method should call to keep track if the input and output tokens utilized.
Returns: . A jagged array of floats representing the embeddings.
Thrown when the method is not implemented.