goai

package module
v0.1.2 Latest Latest
Warning

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

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

README

goai

Go port of the Vercel AI SDK — streaming text generation, tool calling, image/audio generation, embeddings, reranking, transcription.

The TypeScript-flavored API surface is preserved as faithfully as Go syntax allows, so patterns from the Vercel AI SDK docs translate directly. See NOTICE for attribution.

[!WARNING] Alpha software. This is an early-stage port — bugs are likely, especially in code paths that haven't been exercised yet. We use it ourselves but expect to find edge cases. Please open an issue for anything that breaks.

Install

import "github.com/airlockrun/goai"
go get github.com/airlockrun/goai

Requires Go 1.26+.

Streaming text

The main entry point — equivalent to the Vercel AI SDK's streamText():

result, err := goai.StreamText(ctx, stream.Input{
	Model:    yourModel,             // a goai.LanguageModel implementation
	Messages: yourMessages,          // []message.Message
	System:   "You are a helpful assistant.",
	Tools:    yourTools,             // optional
})
if err != nil {
	return err
}

for event := range result.Events() {
	// handle event.TextDelta, event.ToolCall, event.Finish, ...
}

StreamText automatically loops through tool calls when MaxSteps > 1, executing tools and feeding results back into the model — same shape as the upstream multi-step agent loop.

Other top-level functions: GenerateText, GenerateImage, GenerateSpeech, Transcribe, Embed, Rerank.

Scope

goai tracks vercel/ai upstream. We accept bug fixes specific to the Go port, but not changes that diverge from upstream's logic or API design — if you have an idea that improves the SDK conceptually, take it to vercel/ai first; once it lands upstream, it'll flow into goai naturally. See CONTRIBUTING.md for details.

Companion projects

  • airlock (AGPL-3.0) — self-hosted cyborg agent platform
  • agentsdk (Apache-2.0) — Go SDK for building agents on airlock
  • sol (Apache-2.0) — agent runtime / CLI utility, built on goai

License

Apache-2.0. The Vercel AI SDK is also Apache-2.0; see NOTICE for the upstream attribution.

Contributing

See CONTRIBUTING.md and CODE_OF_CONDUCT.md. A CLA Assistant bot will prompt you to sign on your first PR (one signature covers all airlockrun projects).

Security

Email security@airlock.run. Do not open public issues for vulnerabilities.

Documentation

Overview

Package goai provides a Go implementation of AI SDK functionality. It mirrors the Vercel AI SDK (ai package) for streaming LLM interactions.

Package goai provides a Go implementation of AI SDK functionality.

Package goai provides a Go implementation of AI SDK functionality.

Index

Constants

This section is empty.

Variables

View Source
var (
	NewSystemMessage             = message.NewSystemMessage
	NewUserMessage               = message.NewUserMessage
	NewAssistantMessage          = message.NewAssistantMessage
	NewAssistantMessageWithParts = message.NewAssistantMessageWithParts
	NewToolMessage               = message.NewToolMessage
)

Message constructors

Functions

func CosineSimilarity

func CosineSimilarity(a, b []float64) float64

CosineSimilarity calculates the cosine similarity between two embeddings. Returns a value between -1 and 1, where 1 means identical direction.

func DotProduct

func DotProduct(a, b []float64) float64

DotProduct calculates the dot product between two embeddings.

func EuclideanDistance

func EuclideanDistance(a, b []float64) float64

EuclideanDistance calculates the Euclidean distance between two embeddings. Returns a non-negative value, where 0 means identical vectors.

func IsStopConditionMet

func IsStopConditionMet(stopConditions []StopCondition, steps []StepResult) bool

IsStopConditionMet checks if any of the stop conditions are met. Returns true if ANY condition returns true (OR logic). Equivalent to ai-sdk's isStopConditionMet().

func StreamText

func StreamText(ctx context.Context, input stream.Input) (*stream.Result, error)

StreamText streams text generation from a language model. This is the main entry point, equivalent to ai-sdk's streamText(). When MaxSteps > 1, it automatically executes tools and continues the loop, streaming all events from all steps.

func Tool

func Tool(name, description string, schema json.RawMessage, execute tool.ExecuteFunc) tool.Tool

Tool is a convenience function to create a tool definition. Equivalent to ai-sdk's tool() function.

Types

type ContentPart

type ContentPart interface {
	// contains filtered or unexported methods
}

ContentPart is the interface for all content part types.

type EmbedInput

type EmbedInput struct {
	// Model is the embedding model to use.
	Model model.EmbeddingModel

	// Value is the text to embed (for single embedding).
	Value string

	// Values is a list of texts to embed (for batch embedding).
	// If Value is set, it takes precedence.
	Values []string

	// Dimensions is the desired embedding dimensions (if model supports it).
	Dimensions *int

	// AbortSignal allows cancellation.
	AbortSignal context.Context

	// Headers are additional HTTP headers.
	Headers map[string]string

	// ProviderOptions are provider-specific options.
	ProviderOptions map[string]any
}

EmbedInput contains the input for embedding generation.

type EmbedResult

type EmbedResult struct {
	// Embedding is the generated embedding (for single value input).
	Embedding []float64

	// Embeddings contains all generated embeddings (for batch input).
	Embeddings []Embedding

	// Usage contains usage information.
	Usage EmbeddingUsage

	// Response contains response metadata.
	Response EmbeddingResponseMeta
}

EmbedResult contains the result of embedding generation.

func Embed

func Embed(ctx context.Context, input EmbedInput) (*EmbedResult, error)

Embed generates an embedding for a single text.

func EmbedMany

func EmbedMany(ctx context.Context, input EmbedInput) (*EmbedResult, error)

EmbedMany generates embeddings for multiple texts. This is an alias for Embed with multiple values.

type Embedding

type Embedding struct {
	// Values is the embedding vector.
	Values []float64

	// Index is the index of the input text this embedding corresponds to.
	Index int
}

Embedding represents a single embedding.

type EmbeddingResponseMeta

type EmbeddingResponseMeta struct {
	// ID is the response identifier.
	ID string

	// Model is the model used for generation.
	Model string

	// Headers contains response headers.
	Headers map[string]string
}

EmbeddingResponseMeta contains response metadata.

type EmbeddingUsage

type EmbeddingUsage struct {
	// Tokens is the total number of tokens used.
	Tokens int
}

EmbeddingUsage contains usage information for embedding generation.

type EventType

type EventType = stream.EventType

Re-export commonly used types for convenience

type GenerateTextResponseMeta

type GenerateTextResponseMeta struct {
	// ID is the response ID from the provider.
	ID string

	// Model is the model that was used.
	Model string

	// Messages contains the conversation messages including the response.
	Messages []message.Message
}

GenerateTextResponseMeta contains response metadata.

type GenerateTextResult

type GenerateTextResult struct {
	// Text is the generated text from the final step.
	Text string

	// ToolCalls contains tool calls from the final step.
	ToolCalls []stream.ToolCall

	// ToolResults contains tool results from the final step.
	ToolResults []stream.ToolResultEvent

	// Sources contains citation sources (URLs / documents) from the final
	// step — emitted by hosted search/retrieval tools. Mirrors ai-sdk's
	// GenerateTextResult.sources.
	Sources []stream.SourceEvent

	// FinishReason indicates why the final step stopped.
	FinishReason stream.FinishReason

	// Usage contains total token usage across all steps.
	Usage stream.Usage

	// Steps contains all step results when MaxSteps > 1.
	Steps []StepResult

	// Output is the parsed result from Input.Output's ParseComplete.
	// Only populated when Input.Output was set and the final step finished
	// with FinishReasonStop. Type-assert to the expected type.
	Output any

	// Response contains additional response metadata.
	Response GenerateTextResponseMeta
}

GenerateTextResult contains the result of a GenerateText call. Equivalent to ai-sdk's GenerateTextResult.

func GenerateText

func GenerateText(ctx context.Context, input stream.Input) (*GenerateTextResult, error)

GenerateText generates text from a language model (non-streaming). This is equivalent to ai-sdk's generateText(). It waits for the complete response before returning. When MaxSteps > 1, it automatically executes tools and continues the loop.

type GeneratedImage

type GeneratedImage struct {
	// Base64 is the base64-encoded image data.
	Base64 string

	// URL is the URL of the generated image (if available).
	URL string

	// MimeType is the MIME type of the image (e.g., "image/png").
	MimeType string

	// Seed is the seed used for generation (if available).
	Seed *int64

	// RevisedPrompt is the revised prompt used for generation (if available).
	RevisedPrompt string
}

GeneratedImage represents a single generated image.

type ImageInput

type ImageInput struct {
	// Model is the image model to use.
	Model model.ImageModel

	// Prompt is the text description of the image to generate.
	Prompt string

	// N is the number of images to generate (default: 1).
	N int

	// Size is the size of the generated images (e.g., "1024x1024").
	Size string

	// AspectRatio is the aspect ratio (e.g., "16:9", "1:1").
	// Use this instead of Size for models that support aspect ratio.
	AspectRatio string

	// Seed for deterministic generation (if supported).
	Seed *int64

	// AbortSignal allows cancellation.
	AbortSignal context.Context

	// Headers are additional HTTP headers.
	Headers map[string]string

	// ProviderOptions are provider-specific options.
	ProviderOptions map[string]any
}

ImageInput contains the input for image generation.

type ImageResponseMeta

type ImageResponseMeta struct {
	// ID is the response identifier.
	ID string

	// Model is the model used for generation.
	Model string

	// Timestamp is the creation timestamp.
	Timestamp int64

	// Headers contains response headers.
	Headers map[string]string
}

ImageResponseMeta contains response metadata.

type ImageResult

type ImageResult struct {
	// Images contains the generated images.
	Images []GeneratedImage

	// Warnings contains any warnings from the generation process.
	Warnings []stream.Warning

	// Usage contains usage information (if available).
	Usage *ImageUsage

	// Response contains response metadata.
	Response ImageResponseMeta
}

ImageResult contains the result of image generation.

func GenerateImage

func GenerateImage(ctx context.Context, input ImageInput) (*ImageResult, error)

GenerateImage generates images from an image model.

type ImageUsage

type ImageUsage struct {
	// TotalTokens is the total number of tokens used (for models that use tokens).
	TotalTokens int

	// Steps is the number of diffusion steps (for diffusion models).
	Steps int
}

ImageUsage contains usage information for image generation.

type Message

type Message = message.Message

Re-export commonly used types for convenience

type Part

type Part = message.Part

Re-export commonly used types for convenience

type RankedDocument

type RankedDocument struct {
	// Index is the original index of the document.
	Index int

	// Score is the relevance score (higher is more relevant).
	Score float64

	// Document is the document text (if ReturnDocuments was true).
	Document string
}

RankedDocument represents a document with its relevance score.

type ReasoningContentPart

type ReasoningContentPart struct {
	ID              string
	Text            string
	ProviderOptions map[string]any // Contains provider-specific data like "reasoningEncryptedContent"
}

ReasoningContentPart represents reasoning/thinking text.

type ReasoningPart

type ReasoningPart = message.ReasoningPart

Re-export commonly used types for convenience

type RerankInput

type RerankInput struct {
	// Model is the reranking model to use.
	Model model.RerankingModel

	// Query is the query to rank documents against.
	Query string

	// Documents is the list of documents to rerank.
	Documents []string

	// TopN is the number of top results to return (0 means return all).
	TopN int

	// ReturnDocuments specifies whether to include document text in results.
	ReturnDocuments bool

	// AbortSignal allows cancellation.
	AbortSignal context.Context

	// Headers are additional HTTP headers.
	Headers map[string]string

	// ProviderOptions are provider-specific options.
	ProviderOptions map[string]any
}

RerankInput contains the input for document reranking.

type RerankResponseMeta

type RerankResponseMeta struct {
	// ID is the response identifier.
	ID string

	// Model is the model used for reranking.
	Model string

	// Headers contains response headers.
	Headers map[string]string
}

RerankResponseMeta contains response metadata.

type RerankResult

type RerankResult struct {
	// Results contains the reranked documents.
	Results []RankedDocument

	// Usage contains usage information.
	Usage RerankUsage

	// Response contains response metadata.
	Response RerankResponseMeta
}

RerankResult contains the result of document reranking.

func Rerank

func Rerank(ctx context.Context, input RerankInput) (*RerankResult, error)

Rerank reranks documents based on their relevance to a query.

type RerankUsage

type RerankUsage struct {
	// SearchUnits is the number of search units used.
	SearchUnits int

	// Tokens is the total number of tokens processed.
	Tokens int
}

RerankUsage contains usage information for reranking.

type SourceContentPart added in v0.1.2

type SourceContentPart struct {
	stream.SourceEvent
}

SourceContentPart represents a source (URL or document) cited by the model. Emitted by providers with hosted search/retrieval tools.

type SpeechInput

type SpeechInput struct {
	// Model is the speech model to use.
	Model model.SpeechModel

	// Text is the text to convert to speech.
	Text string

	// Voice is the voice to use for generation.
	Voice string

	// OutputFormat is the desired output format (e.g., "mp3", "wav", "opus").
	// Default depends on the provider.
	OutputFormat string

	// Speed is the speed of the generated audio (0.25 to 4.0, 1.0 is normal).
	Speed *float64

	// AbortSignal allows cancellation.
	AbortSignal context.Context

	// Headers are additional HTTP headers.
	Headers map[string]string

	// ProviderOptions are provider-specific options.
	ProviderOptions map[string]any
}

SpeechInput contains the input for speech generation.

type SpeechResponseMeta

type SpeechResponseMeta struct {
	// ID is the response identifier.
	ID string

	// Model is the model used for generation.
	Model string

	// Headers contains response headers.
	Headers map[string]string
}

SpeechResponseMeta contains response metadata.

type SpeechResult

type SpeechResult struct {
	// Audio is the generated audio data.
	Audio []byte

	// AudioReader provides streaming access to the audio data.
	AudioReader io.Reader

	// MimeType is the MIME type of the audio (e.g., "audio/mpeg").
	MimeType string

	// Duration is the duration of the audio in seconds (if available).
	Duration *float64

	// Warnings contains any warnings from the generation process.
	Warnings []stream.Warning

	// Usage contains usage information (if available).
	Usage *SpeechUsage

	// Response contains response metadata.
	Response SpeechResponseMeta
}

SpeechResult contains the result of speech generation.

func GenerateSpeech

func GenerateSpeech(ctx context.Context, input SpeechInput) (*SpeechResult, error)

GenerateSpeech generates speech from text using a speech model.

type SpeechUsage

type SpeechUsage struct {
	// Characters is the number of characters processed.
	Characters int

	// Seconds is the duration of generated audio in seconds.
	Seconds float64
}

SpeechUsage contains usage information for speech generation.

type StepResponseMeta

type StepResponseMeta struct {
	// Messages are the response messages generated in this step.
	Messages []message.Message
}

StepResponseMeta contains response metadata for a step.

type StepResult

type StepResult struct {
	// Content contains all content parts generated in this step.
	Content []ContentPart

	// FinishReason indicates why this step ended.
	FinishReason stream.FinishReason

	// Usage contains token usage for this step.
	Usage stream.Usage

	// Response contains response metadata including messages.
	Response StepResponseMeta
}

StepResult represents the result of a single step in the generation process. Equivalent to ai-sdk's StepResult type.

func (*StepResult) DynamicToolCalls

func (s *StepResult) DynamicToolCalls() []stream.ToolCall

DynamicToolCalls returns tool calls that are dynamic.

func (*StepResult) DynamicToolResults

func (s *StepResult) DynamicToolResults() []stream.ToolResultEvent

DynamicToolResults returns tool results that are dynamic.

func (*StepResult) GetFinishReason

func (s *StepResult) GetFinishReason() stream.FinishReason

GetFinishReason returns the finish reason (implements StepResultData interface).

func (*StepResult) GetUsage

func (s *StepResult) GetUsage() stream.Usage

GetUsage returns the usage statistics (implements StepResultData interface).

func (*StepResult) Reasoning

func (s *StepResult) Reasoning() []ReasoningContentPart

Reasoning returns all reasoning content parts.

func (*StepResult) ReasoningText

func (s *StepResult) ReasoningText() string

ReasoningText returns the concatenated text from all reasoning parts.

func (*StepResult) Sources added in v0.1.2

func (s *StepResult) Sources() []stream.SourceEvent

Sources returns all source content parts cited in this step.

func (*StepResult) StaticToolCalls

func (s *StepResult) StaticToolCalls() []stream.ToolCall

StaticToolCalls returns tool calls that are not dynamic.

func (*StepResult) StaticToolResults

func (s *StepResult) StaticToolResults() []stream.ToolResultEvent

StaticToolResults returns tool results that are not dynamic.

func (*StepResult) Text

func (s *StepResult) Text() string

Text returns the concatenated text from all text content parts.

func (*StepResult) ToolCalls

func (s *StepResult) ToolCalls() []stream.ToolCall

ToolCalls returns all tool call content parts.

func (*StepResult) ToolResults

func (s *StepResult) ToolResults() []stream.ToolResultEvent

ToolResults returns all tool result content parts.

type StopCondition

type StopCondition func(steps []StepResult) bool

StopCondition is a function that determines whether the tool loop should stop. It receives the steps taken so far and returns true if the loop should stop. Equivalent to ai-sdk's StopCondition type.

func HasToolCall

func HasToolCall(toolName string) StopCondition

HasToolCall creates a stop condition that stops when the specified tool is called. It checks the last step's tool calls for a matching tool name. Equivalent to ai-sdk's hasToolCall().

func StepCountIs

func StepCountIs(stepCount int) StopCondition

StepCountIs creates a stop condition that stops after the given number of steps. This is the default stop condition with stepCount=1. Equivalent to ai-sdk's stepCountIs().

type StreamEvent

type StreamEvent = stream.Event

Re-export commonly used types for convenience

type StreamResult

type StreamResult = stream.Result

Re-export commonly used types for convenience

type TextContentPart

type TextContentPart struct {
	Text string
}

TextContentPart represents generated text.

type TextPart

type TextPart = message.TextPart

Re-export commonly used types for convenience

type ToolCallContentPart

type ToolCallContentPart struct {
	stream.ToolCall
	Dynamic bool
}

ToolCallContentPart represents a tool call.

type ToolCallPart

type ToolCallPart = message.ToolCallPart

Re-export commonly used types for convenience

type ToolResultContentPart

type ToolResultContentPart struct {
	stream.ToolResultEvent
	Dynamic bool
}

ToolResultContentPart represents a tool result.

type ToolSet

type ToolSet = tool.Set

Re-export commonly used types for convenience

type TranscribeInput

type TranscribeInput struct {
	// Model is the transcription model to use.
	Model model.TranscriptionModel

	// Audio is the audio data to transcribe.
	Audio []byte

	// AudioReader provides streaming access to audio data (alternative to Audio).
	AudioReader io.Reader

	// MimeType is the MIME type of the audio (e.g., "audio/wav", "audio/mp3").
	MimeType string

	// Filename is the filename of the audio (used for format detection).
	Filename string

	// Language is the language code of the audio (e.g., "en", "es").
	// If not provided, the model will attempt to detect the language.
	Language string

	// Prompt is an optional hint for the model (can improve accuracy).
	Prompt string

	// AbortSignal allows cancellation.
	AbortSignal context.Context

	// Headers are additional HTTP headers.
	Headers map[string]string

	// ProviderOptions are provider-specific options.
	ProviderOptions map[string]any
}

TranscribeInput contains the input for transcription.

type TranscriptionResponseMeta

type TranscriptionResponseMeta struct {
	// ID is the response identifier.
	ID string

	// Model is the model used for transcription.
	Model string

	// Headers contains response headers.
	Headers map[string]string
}

TranscriptionResponseMeta contains response metadata.

type TranscriptionResult

type TranscriptionResult struct {
	// Text is the transcribed text.
	Text string

	// Segments contains detailed segment information (if available).
	Segments []TranscriptionSegment

	// Language is the detected language code.
	Language string

	// Duration is the duration of the audio in seconds (if available).
	Duration *float64

	// Warnings contains any warnings from the transcription process.
	Warnings []stream.Warning

	// Usage contains usage information (if available).
	Usage *TranscriptionUsage

	// Response contains response metadata.
	Response TranscriptionResponseMeta
}

TranscriptionResult contains the result of transcription.

func Transcribe

func Transcribe(ctx context.Context, input TranscribeInput) (*TranscriptionResult, error)

Transcribe transcribes audio to text using a transcription model.

type TranscriptionSegment

type TranscriptionSegment struct {
	// ID is the segment identifier.
	ID int

	// Text is the transcribed text for this segment.
	Text string

	// Start is the start time in seconds.
	Start float64

	// End is the end time in seconds.
	End float64

	// Confidence is the confidence score (0 to 1).
	Confidence float64

	// Words contains word-level information (if available).
	Words []TranscriptionWord
}

TranscriptionSegment represents a segment of transcribed audio.

type TranscriptionUsage

type TranscriptionUsage struct {
	// DurationSeconds is the duration of audio processed in seconds.
	DurationSeconds float64
}

TranscriptionUsage contains usage information for transcription.

type TranscriptionWord

type TranscriptionWord struct {
	// Word is the transcribed word.
	Word string

	// Start is the start time in seconds.
	Start float64

	// End is the end time in seconds.
	End float64

	// Confidence is the confidence score (0 to 1).
	Confidence float64
}

TranscriptionWord represents a single word in the transcription.

Directories

Path Synopsis
Package errors provides custom error types for the goai package.
Package errors provides custom error types for the goai package.
Package integration provides utilities for integration testing of AI providers.
Package integration provides utilities for integration testing of AI providers.
Package internal provides shared utilities for the goai package.
Package internal provides shared utilities for the goai package.
Package mcp provides Model Context Protocol (MCP) client functionality.
Package mcp provides Model Context Protocol (MCP) client functionality.
Package message defines the core message types used in AI conversations.
Package message defines the core message types used in AI conversations.
Package middleware provides composable model transformations.
Package middleware provides composable model transformations.
Package model defines the interfaces for different AI model types.
Package model defines the interfaces for different AI model types.
Package output provides output strategies for structured text generation.
Package output provides output strategies for structured text generation.
Package prompt provides message conversion utilities.
Package prompt provides message conversion utilities.
Package provider defines the interface for LLM providers.
Package provider defines the interface for LLM providers.
anthropic
Package anthropic provides an Anthropic provider implementation.
Package anthropic provides an Anthropic provider implementation.
assemblyai
Package assemblyai provides an AssemblyAI provider implementation for transcription.
Package assemblyai provides an AssemblyAI provider implementation for transcription.
azure
Package azure provides an Azure OpenAI provider implementation.
Package azure provides an Azure OpenAI provider implementation.
baseten
Package baseten provides a Baseten provider implementation.
Package baseten provides a Baseten provider implementation.
bedrock
Package bedrock provides an Amazon Bedrock provider implementation.
Package bedrock provides an Amazon Bedrock provider implementation.
blackforestlabs
Package blackforestlabs provides a Black Forest Labs (Flux) provider implementation.
Package blackforestlabs provides a Black Forest Labs (Flux) provider implementation.
cerebras
Package cerebras provides a Cerebras provider implementation.
Package cerebras provides a Cerebras provider implementation.
cohere
Package cohere provides a Cohere provider implementation.
Package cohere provides a Cohere provider implementation.
deepgram
Package deepgram provides a Deepgram provider implementation for speech and transcription.
Package deepgram provides a Deepgram provider implementation for speech and transcription.
deepinfra
Package deepinfra provides a DeepInfra provider implementation.
Package deepinfra provides a DeepInfra provider implementation.
deepseek
Package deepseek provides a DeepSeek provider implementation.
Package deepseek provides a DeepSeek provider implementation.
elevenlabs
Package elevenlabs provides an ElevenLabs provider implementation for speech generation.
Package elevenlabs provides an ElevenLabs provider implementation for speech generation.
fal
Package fal provides a fal.ai provider implementation for image generation.
Package fal provides a fal.ai provider implementation for image generation.
fireworks
Package fireworks provides a Fireworks AI provider implementation.
Package fireworks provides a Fireworks AI provider implementation.
gladia
Package gladia provides a Gladia provider implementation for transcription.
Package gladia provides a Gladia provider implementation for transcription.
google
Package google provides a Google AI (Gemini) provider implementation.
Package google provides a Google AI (Gemini) provider implementation.
groq
Package groq provides a Groq provider implementation.
Package groq provides a Groq provider implementation.
huggingface
Package huggingface provides a Hugging Face Inference API provider implementation.
Package huggingface provides a Hugging Face Inference API provider implementation.
hume
Package hume provides a Hume AI provider implementation for expressive speech.
Package hume provides a Hume AI provider implementation for expressive speech.
lmnt
Package lmnt provides an LMNT provider implementation for speech generation.
Package lmnt provides an LMNT provider implementation for speech generation.
luma
Package luma provides a Luma Labs provider implementation for video/image generation.
Package luma provides a Luma Labs provider implementation for video/image generation.
mistral
Package mistral provides a Mistral AI provider implementation.
Package mistral provides a Mistral AI provider implementation.
openai
Package openai provides an OpenAI provider implementation.
Package openai provides an OpenAI provider implementation.
openaicompat
Package openaicompat provides an OpenAI-compatible provider base.
Package openaicompat provides an OpenAI-compatible provider base.
perplexity
Package perplexity provides a Perplexity provider implementation.
Package perplexity provides a Perplexity provider implementation.
prodia
Package prodia provides a Prodia provider implementation for image generation.
Package prodia provides a Prodia provider implementation for image generation.
proxy
Package proxy implements a stream.Model that proxies LLM calls through an Airlock-compatible NDJSON endpoint (POST /api/agent/llm/stream).
Package proxy implements a stream.Model that proxies LLM calls through an Airlock-compatible NDJSON endpoint (POST /api/agent/llm/stream).
replicate
Package replicate provides a Replicate provider implementation.
Package replicate provides a Replicate provider implementation.
revai
Package revai provides a Rev.ai provider implementation for transcription.
Package revai provides a Rev.ai provider implementation for transcription.
togetherai
Package togetherai provides a Together AI provider implementation.
Package togetherai provides a Together AI provider implementation.
vertex
Package vertex provides a Google Vertex AI provider implementation.
Package vertex provides a Google Vertex AI provider implementation.
vertexanthropic
Package vertexanthropic provides a Google Vertex AI Anthropic provider.
Package vertexanthropic provides a Google Vertex AI Anthropic provider.
vertexmaas
Package vertexmaas provides a Google Vertex AI MaaS (Model as a Service) provider.
Package vertexmaas provides a Google Vertex AI MaaS (Model as a Service) provider.
xai
Package xai provides an xAI (Grok) provider implementation.
Package xai provides an xAI (Grok) provider implementation.
Package response provides HTTP response handlers for API calls.
Package response provides HTTP response handlers for API calls.
Package schema provides JSON Schema utilities for structured output.
Package schema provides JSON Schema utilities for structured output.
Package stream defines the streaming events from LLM responses.
Package stream defines the streaming events from LLM responses.
Package testutil provides test utilities for goai.
Package testutil provides test utilities for goai.
Package tool provides tool definition and execution for AI models.
Package tool provides tool definition and execution for AI models.

Jump to

Keyboard shortcuts

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