Gateway Class
The main class for interacting with LLMs through the Adaline Gateway.Constructor
Parameters
GatewayOptionsType
Optional configuration for plugins.
Methods
completeChat
Non-streaming chat completion. Sends messages to an LLM and returns the full response.GatewayCompleteChatRequestType
required
CompleteChatHandlerResponseType
streamChat
Streaming chat completion. Returns an async generator that yields response chunks.GatewayStreamChatRequestType
required
Same shape as
completeChat request. See above.AsyncGenerator<StreamChatHandlerResponseType>
getEmbeddings
Generate embeddings for text or other modalities.GatewayGetEmbeddingsRequestType
required
GetEmbeddingsHandlerResponseType
getToolResponses
Execute tool calls returned by an LLM.GatewayGetToolResponsesRequestType
required
GetToolResponsesHandlerResponseType
getChatUsageCost (static)
Calculate the cost of a chat completion based on token usage.GetChatUsageCostHandlerResponseType