Module openai

Source
Available on crate feature openai only.
Expand description

This module provides integration with OpenAI’s API, enabling the use of language models and embeddings within the Swiftide project. It includes the OpenAI struct for managing API clients and default options for embedding and prompt models. The module is conditionally compiled based on the “openai” feature flag.

Structs§

AzureConfig
Configuration for Azure OpenAI Service
GenericOpenAI
Generic client for OpenAI APIs.
GenericOpenAIBuilder
Builder for GenericOpenAI.
OpenAIConfig
Configuration for OpenAI API
Options
The Options struct holds configuration options for the OpenAI client. It includes optional fields for specifying the embedding and prompt models.
OptionsBuilder
Builder for Options.

Enums§

GenericOpenAIBuilderError
Error type for GenericOpenAIBuilder
OptionsBuilderError
Error type for OptionsBuilder

Functions§

openai_error_to_language_model_error

Type Aliases§

OpenAI
The OpenAI struct encapsulates an OpenAI client and default options for embedding and prompt models. It uses the Builder pattern for flexible and customizable instantiation.
OpenAIBuilder