llm

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Message string
}

type Provider

type Provider interface {
	NewResponses(ctx context.Context, in *responses.Request) (*responses.Response, error)
	NewStreamingResponses(ctx context.Context, in *responses.Request) (chan *responses.ResponseChunk, error)
	NewEmbedding(ctx context.Context, in *embeddings.Request) (*embeddings.Response, error)
	NewChatCompletion(ctx context.Context, in *chat_completion.Request) (*chat_completion.Response, error)
	NewStreamingChatCompletion(ctx context.Context, in *chat_completion.Request) (chan *chat_completion.ResponseChunk, error)
	NewSpeech(ctx context.Context, in *speech.Request) (*speech.Response, error)
	NewStreamingSpeech(ctx context.Context, in *speech.Request) (chan *speech.ResponseChunk, error)
}

type ProviderName

type ProviderName string
var (
	ProviderNameOpenAI    ProviderName = "OpenAI"
	ProviderNameAnthropic ProviderName = "Anthropic"
	ProviderNameGemini    ProviderName = "Gemini"
	ProviderNameXAI       ProviderName = "xAI"
	ProviderNameOllama    ProviderName = "Ollama"
)

func GetAllProviderNames

func GetAllProviderNames() []ProviderName

func (*ProviderName) IsValid

func (p *ProviderName) IsValid() bool

type Request

type Request struct {
	OfEmbeddingsInput     *embeddings.Request
	OfResponsesInput      *responses.Request
	OfChatCompletionInput *chat_completion.Request
	OfSpeech              *speech.Request
}

func (*Request) GetRequestedModel

func (r *Request) GetRequestedModel() string

type Response

type Response struct {
	OfEmbeddingsOutput     *embeddings.Response
	OfResponsesOutput      *responses.Response
	OfChatCompletionOutput *chat_completion.Response
	OfSpeech               *speech.Response
	Error                  *Error
}

type StreamingResponse

type StreamingResponse struct {
	ResponsesStreamData      chan *responses.ResponseChunk
	ChatCompletionStreamData chan *chat_completion.ResponseChunk
	SpeechStreamData         chan *speech.ResponseChunk
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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