Documentation
¶
Overview ¶
Package openrouter implements the OpenRouter provider.
Index ¶
- func WithCapabilities(m model.Model, info SupportedParameters, inputModalities []string) model.Model
- type Client
- func (c *Client) Chat(ctx context.Context, req request.Request, streamFunc stream.Func) (message.Message, usage.Usage, error)
- func (c *Client) Embed(ctx context.Context, req embedding.Request) (embedding.Response, usage.Usage, error)
- func (c *Client) Estimate(_ context.Context, _ request.Request, _ string) (int, error)
- func (c *Client) Model(ctx context.Context, name string) (model.Model, error)
- func (c *Client) Models(ctx context.Context) (model.Models, error)
- type SupportedParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCapabilities ¶
func WithCapabilities(m model.Model, info SupportedParameters, inputModalities []string) model.Model
WithCapabilities adds capabilities to a model based on supported parameters and input modalities.
Types ¶
type Client ¶
type Client struct {
*openrouter.Client
// contains filtered or unexported fields
}
Client wraps the OpenRouter API client with Fantasy for chat.
func (*Client) Chat ¶
func (c *Client) Chat( ctx context.Context, req request.Request, streamFunc stream.Func, ) (message.Message, usage.Usage, error)
Chat sends a chat completion request via Fantasy with streaming support.
func (*Client) Embed ¶
func (c *Client) Embed(ctx context.Context, req embedding.Request) (embedding.Response, usage.Usage, error)
Embed generates embeddings for the given input texts.
type SupportedParameters ¶
type SupportedParameters []string
SupportedParameters contains parameter names supported by a model.
Click to show internal directories.
Click to hide internal directories.