adapter

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package adapter bridges Aura's LLM types with Fantasy's unified provider abstraction. It converts requests, messages, tools, and streaming responses between the two systems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapError

func MapError(err error) error

MapError converts Fantasy errors to Aura error sentinels.

func SetGeneration

func SetGeneration(c *fantasy.Call, gen *generation.Generation)

SetGeneration maps Aura's generation parameters onto a Fantasy Call.

func StreamToMessage

func StreamToMessage(streamIter func(func(fantasy.StreamPart) bool), fn stream.Func, providerHint string) (message.Message, usage.Usage, error)

StreamToMessage consumes a Fantasy stream, calls fn for incremental deltas, and returns the accumulated Aura message + usage. providerHint identifies the provider for ThinkingSignature extraction (e.g., "anthropic", "google").

func ToCall

func ToCall(msgs message.Messages, tools tool.Schemas) fantasy.Call

ToCall converts Aura messages and tool schemas to a Fantasy Call. System messages are converted to Fantasy system messages within the Prompt. Provider-specific options (thinking, reasoning, store) are NOT set here — each provider adds them via Call.ProviderOptions after calling ToCall.

func ToMessage

func ToMessage(msg message.Message) fantasy.Message

ToMessage converts a single Aura message to a Fantasy Message. For assistant messages, parts are ordered: ReasoningPart → TextPart → ToolCallPart(s).

func ToTools

func ToTools(schemas tool.Schemas) []fantasy.Tool

ToTools converts Aura tool schemas to Fantasy FunctionTools.

Types

This section is empty.

Jump to

Keyboard shortcuts

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