client

package
v0.0.0-...-1421e74 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ptr

func Ptr[T any](v T) *T

Types

type Client

type Client struct {
	Models ModelService

	Embeddings  EmbeddingService
	Completions CompletionService

	Syntheses      SynthesisService
	Renderings     RenderingService
	Transcriptions TranscriptionService

	Scrapes    ScrapeService
	Searches   SearchService
	Researches ResearchService

	Segments    SegmentService
	Extractions ExtractionService

	Summaries SummaryService
}

func New

func New(url string, opts ...RequestOption) *Client

type CompleteOptions

type CompleteOptions = provider.CompleteOptions

type Completion

type Completion = provider.Completion

type CompletionAccumulator

type CompletionAccumulator = provider.CompletionAccumulator

type CompletionRequest

type CompletionRequest struct {
	CompleteOptions

	Model    string
	Messages []Message
}

type CompletionService

type CompletionService struct {
	Options []RequestOption
}

func NewCompletionService

func NewCompletionService(opts ...RequestOption) CompletionService

func (*CompletionService) New

func (*CompletionService) NewStream

type Content

type Content = provider.Content

type Effort

type Effort = provider.Effort

type Embedding

type Embedding = provider.Embedding

type EmbeddingService

type EmbeddingService struct {
	Options []RequestOption
}

func NewEmbeddingService

func NewEmbeddingService(opts ...RequestOption) EmbeddingService

func (*EmbeddingService) New

type EmbeddingsRequest

type EmbeddingsRequest struct {
	Model string

	Texts []string
}

type Extraction

type Extraction struct {
	Text string `json:"text"`
}

type ExtractionRequest

type ExtractionRequest struct {
	Name   string
	Reader io.Reader
}

type ExtractionService

type ExtractionService struct {
	Options []RequestOption
}

func NewExtractionService

func NewExtractionService(opts ...RequestOption) ExtractionService

func (*ExtractionService) New

type Image

type Image struct {
	Name   string
	Reader io.Reader
}

type Message

type Message = provider.Message

func AssistantMessage

func AssistantMessage(content string) Message

func SystemMessage

func SystemMessage(content string) Message

func ToolMessage

func ToolMessage(id, content string) Message

func UserMessage

func UserMessage(content string) Message

type Model

type Model = provider.Model

type ModelService

type ModelService struct {
	Options []RequestOption
}

func NewModelService

func NewModelService(opts ...RequestOption) ModelService

func (*ModelService) List

func (r *ModelService) List(ctx context.Context, opts ...RequestOption) ([]Model, error)

type Rendering

type Rendering struct {
	Content     []byte
	ContentType string
}

type RenderingRequest

type RenderingRequest struct {
	Model string
	Input string

	Images []Image
}

type RenderingService

type RenderingService struct {
	Options []RequestOption
}

func NewRenderingService

func NewRenderingService(opts ...RequestOption) RenderingService

func (*RenderingService) New

type RequestConfig

type RequestConfig struct {
	Client *http.Client

	URL   string
	Token string
}

type RequestOption

type RequestOption = func(*RequestConfig) error

func WithClient

func WithClient(client *http.Client) RequestOption

func WithToken

func WithToken(token string) RequestOption

func WithURL

func WithURL(url string) RequestOption

type Rerank

type Rerank = api.Result

type RerankRequest

type RerankRequest = api.RerankRequest

type RerankService

type RerankService struct {
	Options []RequestOption
}

func NewRerankService

func NewRerankService(opts ...RequestOption) *RerankService

func (*RerankService) New

func (r *RerankService) New(ctx context.Context, input RerankRequest, opts ...RequestOption) ([]Rerank, error)

type ResearchRequest

type ResearchRequest struct {
	Input string
}

type ResearchResult

type ResearchResult = api.ResearchResult

type ResearchService

type ResearchService struct {
	Options []RequestOption
}

func NewResearchService

func NewResearchService(opts ...RequestOption) ResearchService

func (*ResearchService) New

type Schema

type Schema = provider.Schema

type Scrape

type Scrape struct {
	Text string `json:"text"`
}

type ScrapeRequest

type ScrapeRequest struct {
	URL string
}

type ScrapeService

type ScrapeService struct {
	Options []RequestOption
}

func NewScrapeService

func NewScrapeService(opts ...RequestOption) ScrapeService

func (*ScrapeService) New

func (r *ScrapeService) New(ctx context.Context, input ScrapeRequest, opts ...RequestOption) (*Scrape, error)

type SearchRequest

type SearchRequest struct {
	Query string
}

type SearchResult

type SearchResult = api.SearchResult

type SearchService

type SearchService struct {
	Options []RequestOption
}

func NewSearchService

func NewSearchService(opts ...RequestOption) SearchService

func (*SearchService) New

func (r *SearchService) New(ctx context.Context, input SearchRequest, opts ...RequestOption) ([]SearchResult, error)

type Segment

type Segment = api.Segment

type SegmentRequest

type SegmentRequest struct {
	Name   string
	Reader io.Reader

	SegmentLength  *int
	SegmentOverlap *int
}

type SegmentService

type SegmentService struct {
	Options []RequestOption
}

func NewSegmentService

func NewSegmentService(opts ...RequestOption) SegmentService

func (*SegmentService) New

func (r *SegmentService) New(ctx context.Context, input SegmentRequest, opts ...RequestOption) ([]Segment, error)

type Summary

type Summary struct {
	Text string `json:"content"`
}

type SummaryRequest

type SummaryRequest struct {
	Name   string
	Reader io.Reader
}

type SummaryService

type SummaryService struct {
	Options []RequestOption
}

func NewSummaryService

func NewSummaryService(opts ...RequestOption) SummaryService

func (*SummaryService) New

func (r *SummaryService) New(ctx context.Context, input SummaryRequest, opts ...RequestOption) (*Summary, error)

type Synthesis

type Synthesis = provider.Synthesis

type SynthesisService

type SynthesisService struct {
	Options []RequestOption
}

func NewSynthesisService

func NewSynthesisService(opts ...RequestOption) SynthesisService

func (*SynthesisService) New

type SynthesizeOptions

type SynthesizeOptions = provider.SynthesizeOptions

type SynthesizeRequest

type SynthesizeRequest struct {
	SynthesizeOptions

	Model string

	Input string
}

type Tool

type Tool = provider.Tool

type ToolCall

type ToolCall = provider.ToolCall

type ToolResult

type ToolResult = provider.ToolResult

type TranscribeOptions

type TranscribeOptions = provider.TranscribeOptions

type TranscribeRequest

type TranscribeRequest struct {
	TranscribeOptions

	Model string

	Name   string
	Reader io.Reader
}

type Transcription

type Transcription = provider.Transcription

type TranscriptionService

type TranscriptionService struct {
	Options []RequestOption
}

func NewTranscriptionService

func NewTranscriptionService(opts ...RequestOption) TranscriptionService

func (*TranscriptionService) New

type Verbosity

type Verbosity = provider.Verbosity

Jump to

Keyboard shortcuts

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