Module open_router

Source
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 SimplePrompt trait for the OpenRouter struct. It defines an asynchronous function to interact with the OpenRouter API, allowing prompt processing and generating responses as part of the Swiftide system.

Structs§

OpenRouter
The OpenRouter struct encapsulates an OpenRouter client and default options for embedding and prompt models. It uses the Builder pattern for flexible and customizable instantiation.
OpenRouterBuilder
Builder for OpenRouter.
Options
The Options struct holds configuration options for the OpenRouter client. It includes optional fields for specifying the embedding and prompt models.
OptionsBuilder
Builder for Options.

Enums§

OpenRouterBuilderError
Error type for OpenRouterBuilder
OptionsBuilderError
Error type for OptionsBuilder