Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatMessage ¶
type ChatRequest ¶
type ChatRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Stream bool `json:"stream,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
MaxTokens *int `json:"max_tokens,omitempty"`
}
type EmbeddingItem ¶ added in v0.2.0
type EmbeddingRequest ¶ added in v0.2.0
type EmbeddingResponse ¶ added in v0.2.0
type EmbeddingResponse struct {
Object string `json:"object"`
Data []EmbeddingItem `json:"data"`
Model string `json:"model"`
Usage map[string]int `json:"usage"`
}
type Provider ¶
type Provider interface {
ID() string
Type() string
ChatCompletion(ctx context.Context, req *ChatRequest) (body io.ReadCloser, isStream bool, statusCode int, err error)
Embeddings(ctx context.Context, req *EmbeddingRequest) (*EmbeddingResponse, error)
Models(ctx context.Context) ([]ModelInfo, error)
IsHealthy() bool
}
Click to show internal directories.
Click to hide internal directories.