Available on crate feature
open-router only.Expand description
This module provides integration with OpenRouter’s API, enabling the use of language models
and embeddings within the Swiftide project. It includes the OpenRouter struct for managing API
clients and default options for embedding and prompt models. The module is conditionally
compiled based on the “openrouter” feature flag.
Modules§
- chat_
completion - config
- simple_
prompt - This module provides an implementation of the
SimplePrompttrait for theOpenRouterstruct. It defines an asynchronous function to interact with theOpenRouterAPI, allowing prompt processing and generating responses as part of the Swiftide system.
Structs§
- Open
Router - The
OpenRouterstruct encapsulates anOpenRouterclient and default options for embedding and prompt models. It uses theBuilderpattern for flexible and customizable instantiation. - Open
Router Builder - Builder for
OpenRouter. - Options
- The
Optionsstruct holds configuration options for theOpenRouterclient. It includes optional fields for specifying the embedding and prompt models. - Options
Builder - Builder for
Options.
Enums§
- Open
Router Builder Error - Error type for OpenRouterBuilder
- Options
Builder Error - Error type for OptionsBuilder