LogoLogo
HomeNewsSupportVideos
  • Welcome
  • Wisej.NET
  • Concepts
    • Getting Started
    • General Concepts
    • Architecture
    • Extensibility
    • AI Providers
    • Vector Databases
    • Usage Metrics
    • Logging & Error Handling
  • Markup
  • Components
    • API
      • SmartAdapter
        • SmartAudioTTSAdapter
        • SmartAudioWhisperAdapter
        • SmartCalendarAdapter
        • SmartChartAdapter
        • SmartChartJS3Adapter
        • SmartChatBoxAdapter
        • SmartComboBoxAdapter
        • SmartCopilotAdapter
        • SmartDataEntryAdapter
        • SmartDocumentAdapter
        • SmartFullCalendarAdapter
        • SmartObjectAdapter
        • SmartPictureBoxAdapter
        • SmartQueryAdapter
        • SmartRealtimeAdapter
        • SmartReportAdapter
        • SmartTextBoxAdapter
        • SmartAdapter.ExtendsAttribute
        • SmartAdapter.FieldNameAttribute
        • SmartAdapter.FieldPromptAttribute
        • SmartAdapter.FieldRectangleAttribute
        • SmartAdapter.WorksWithAttribute
      • SmartEndpoint
        • AmazonBedrockEndpoint
        • AnthropicEndpoint
        • AzureAIEndpoint
        • CerebrasEndpoint
        • DeepSeekEndpoint
        • GoogleAIEndpoint
        • GroqCloudEndpoint
        • GroqCloudEndpointWhisper
        • HuggingFaceEndpoint
        • HuggingFaceJavaScriptEndpoint
        • LocalAIEndpoint
        • LocalAIEndpointImageGen
        • LocalAIEndpointTTS
        • LocalAIEndpointWhisper
        • NvidiaAIEndpoint
        • OllamaEndpoint
        • OpenAIEndpoint
        • OpenAIEndpointDallE
        • OpenAIEndpointRealtime
        • OpenAIEndpointTTS
        • OpenAIEndpointWhisper
        • SambaNovaEndpoint
        • SmartHttpEndpoint
        • TogetherAIEndpoint
        • XAIEndpoint
        • SmartEndpoint.Metrics
        • SmartEndpoint.Response
      • SmartExtensions
      • SmartHub
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartObject
      • SmartPrompt
        • SmartAgentPrompt
        • SmartParallelPrompt
        • SmartPrompt.Parameter
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
      • SmartRealtimeSession
      • SmartSession
        • SmartSession.ConvertParameterEventArgs
        • SmartSession.ConvertParameterEventHandler
        • SmartSession.ErrorEventArgs
        • SmartSession.ErrorEventHandler
        • SmartSession.InvokeToolEventArgs
        • SmartSession.InvokeToolEventHandler
        • SmartSession.Message
        • SmartSession.MessageCollection
        • SmartSession.MessageRole
        • SmartSession.MessagesEventArgs
        • SmartSession.MessagesEventHandler
        • SmartSession.TrimmingStrategy
      • SmartTool
        • SmartTool.IToolProvider
        • SmartTool.ToolAttribute
        • SmartTool.ToolContext
      • Markup
        • MarkupExtensions
      • Controls
        • UVLightOverlay
      • Embeddings
        • EmbeddedDocument
        • Embedding
        • Matches
        • Metadata
      • Helpers
        • ApiKeys
        • Markdown
        • TextTokenizer
      • Services
        • DefaultSessionTrimmingService
        • IDocumentConversionService
          • DefaultDocumentConversionService
        • IEmbeddingGenerationService
          • DefaultEmbeddingGenerationService
          • HuggingFaceEmbeddingGenerationService
        • IEmbeddingStorageService
          • AzureAISearchEmbeddingStorageService
          • ChromaEmbeddingStorageService
          • FileSystemEmbeddingStorageService
          • MemoryEmbeddingStorageService
          • PineconeEmbeddingStorageService
          • QdrantEmbeddingStorageService
        • IHttpClientService
          • DefaultHttpClientService
        • ILoggerService
          • DefaultLoggerService
        • IOCRService
          • DefaultOCRService
        • IRerankingService
          • DefaultRerankingService
          • LocalAIRerankingService
          • PineconeRerankingService
        • ISessionTrimmingService
          • DefaultSessionTrimmingService
        • ITextSplitterService
          • RecursiveCharacterTextSplitterService
          • TextSplitterServiceBase
        • ITokenizerService
          • DefaultTokenizerService
        • IWebSearchService
          • BingWebSearchService
          • BraveWebSearchService
          • GoogleWebSearchService
      • Tools
        • ArxivTools
        • ChartJS3Tools
        • DatabaseTools
        • DataTableFilterTools
        • DocumentSearchTools
        • DocumentTools
        • FullCalendarTools
        • IToolsContainer
        • MathTools
        • ToolsContainer
        • UtilityTools
        • WebSearchTools
    • Built-in Services
      • IOCRService
      • ILoggerService
      • ITextSplitterService
      • ITokenizerService
      • IHttpClientService
      • IWebSearchService
      • IRerankingService
      • ISessionTrimmingService
      • IDocumentConversionService
      • IEmbeddingStorageService
      • IEmbeddingGenerationService
    • Built-in SmartTools
      • ToolsContainer
      • MathTools
      • UtilityTools
      • DatabaseTools
      • DocumentTools
      • DocumentSearchTools
      • WebSearchTools
      • ChartJS3Tools
      • FullCalendarTools
    • Built-in SmartAdapters
      • SmartAdapter
      • SmartAudioTTSAdapter
      • SmartAudioWhisperAdapter
      • SmartCalendarAdapter
      • SmartChartAdapter
      • SmartChartJS3Adapter
      • SmartChatBoxAdapter
      • SmartComboBoxAdapter
      • SmartCopilotAdapter
      • SmartDataEntryAdapter
      • SmartDocumentAdapter
      • SmartFullCalendarAdapter
      • SmartObjectAdapter
      • SmartPictureBoxAdapter
      • SmartQueryAdapter
      • SmartRealtimeAdapter
      • SmartReportAdapter
      • SmartTextBoxAdapter
    • Configure Services
    • Using SmartHub
    • Using SmartTools
    • Using SmartPrompt
    • Using SmartSession
    • Using SmartRealTimeAdapter
    • UVLightOverlay Control
Powered by GitBook
On this page
  • Constructors
  • OpenAIEndpoint()
  • Properties
  • EmbeddingModel
  • Model
  • URL
  • UseNativeTools
  • Methods
  • AddOptions(message, session)
  • BuildEmbeddingsPayload(inputs)
  • BuildMessage(message)
  • GetApiURL()
  • GetEmbeddingsURL()
  • ReadEmbeddingsResponse(response)
  • Inherited By
Export as PDF
  1. Components
  2. API
  3. SmartEndpoint

OpenAIEndpoint

Wisej.AI.Endpoints.OpenAIEndpoint

PreviousOllamaEndpointNextOpenAIEndpointDallE

Last updated 5 days ago

Namespace: Wisej.AI.Endpoints

Assembly: Wisej.AI (3.5.0.0)

Represents an endpoint for connecting to OpenAI services.

public class OpenAIEndpoint : SmartHttpEndpoint
Public Class OpenAIEndpoint
    Inherits SmartHttpEndpoint

This class is used to interact with OpenAI's API, providing methods to send requests and process responses for both chat completions and embeddings.

Constructors

OpenAIEndpoint()

Initializes a new instance of the class with default settings.

The default authentication is set to "Bearer".

Properties

EmbeddingModel

Methods

Adds options to the message for the API request.

Parameter
Type
Description

message

The message to be sent to the API.

session

The current session context.

Builds the payload for an embeddings request.

Parameter
Type
Description

inputs

The input strings to be embedded.

Throws:

Builds the message payload for the API request.

Parameter
Type
Description

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.

Parameter
Type
Description

response

The response received from the API.

Throws:

Inherited By

Name
Description

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")

Model

: Gets or sets the model used for chat completions. (Default: "gpt-4o")

URL

: Gets or sets the base URL for the OpenAI API. (Default: "https://api.openai.com/v1")

UseNativeTools

: (Default: True)

AddOptions(message, session)

Sets the temperature to 0.0 and max tokens to the value of .

BuildEmbeddingsPayload(inputs)

Returns: . The constructed payload for the embeddings request.

Thrown when the inputs are null.

BuildMessage(message)

Returns: . The constructed message payload.

Thrown when the message is null.

GetApiURL()

Returns: . The full API URL for chat completions.

GetEmbeddingsURL()

Returns: . The full API URL for embeddings.

ReadEmbeddingsResponse(response)

Returns: . An array of float arrays representing the embeddings.

Thrown when the response is null.

String
String
String
Boolean
Object
ArgumentNullException
Object
ArgumentNullException
String
String
Single[][]
ArgumentNullException
Object
SmartSession
String[]
Message
Response
CerebrasEndpoint
DeepSeekEndpoint
GroqCloudEndpoint
HuggingFaceEndpoint
LocalAIEndpoint
NvidiaAIEndpoint
SambaNovaEndpoint
TogetherAIEndpoint
XAIEndpoint
SmartEndpoint
SmartHttpEndpoint
OpenAIEndpoint
OpenAIEndpoint
MaxOutputTokens