ollama

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEmbeddingRequest

type CreateEmbeddingRequest struct {
	Model  string `json:"model"`
	Prompt string `json:"prompt"`
}

func (*CreateEmbeddingRequest) JSON

func (c *CreateEmbeddingRequest) JSON() (string, error)

type CreateEmbeddingResponse

type CreateEmbeddingResponse struct {
	Embedding []float32 `json:"embedding"`
}

type OllamaClient

type OllamaClient struct {
	BaseURL        string
	Model          string
	Client         *http.Client
	DefaultHeaders map[string]string
}

func NewOllamaClient

func NewOllamaClient(opts ...Option) (*OllamaClient, error)

type OllamaEmbeddingFunction

type OllamaEmbeddingFunction struct {
	// contains filtered or unexported fields
}

func NewOllamaEmbeddingFunction

func NewOllamaEmbeddingFunction(option ...Option) (*OllamaEmbeddingFunction, error)

func (*OllamaEmbeddingFunction) EmbedDocuments

func (e *OllamaEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]*types.Embedding, error)

func (*OllamaEmbeddingFunction) EmbedQuery

func (e *OllamaEmbeddingFunction) EmbedQuery(ctx context.Context, document string) (*types.Embedding, error)

func (*OllamaEmbeddingFunction) EmbedRecords

func (e *OllamaEmbeddingFunction) EmbedRecords(ctx context.Context, records []*types.Record, force bool) error

type Option

type Option func(p *OllamaClient) error

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithModel

func WithModel(model string) Option

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL