Documentation
¶
Index ¶
Constants ¶
View Source
const (
// BaseURL is Ollama HTTP API embeddings base URL.
BaseURL = "http://localhost:11434/api"
)
Variables ¶
This section is empty.
Functions ¶
func NewEmbedder ¶
func NewEmbedder(opts ...Option) embeddings.Embedder[*EmbeddingRequest]
NewEmbedder creates a client that implements embeddings.Embedder
Types ¶
type APIError ¶
type APIError struct {
ErrorMessage string `json:"error"`
}
APIError is Ollama API error.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an OpenAI HTTP API client.
type EmbedddingResponse ¶
type EmbedddingResponse struct {
Embedding []float64 `json:"embedding"`
}
EmbedddingResponse received from API.
func (*EmbedddingResponse) ToEmbeddings ¶
func (e *EmbedddingResponse) ToEmbeddings() ([]*embeddings.Embedding, error)
ToEmbeddings converts the API response, into a slice of embeddings and returns it.
type EmbeddingRequest ¶
EmbeddingRequest is serialized and sent to the API server.
type Option ¶
type Option func(*Options)
Option is functional option.
func WithHTTPClient ¶
WithVersion sets the API version. WithHTTPClient sets the HTTP client.
Click to show internal directories.
Click to hide internal directories.