transform

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package transform will contain provider request and response transforms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropUnansweredToolCalls added in v0.4.0

func DropUnansweredToolCalls(req sigma.Request) sigma.Request

DropUnansweredToolCalls returns a copy of req with replayed assistant tool calls removed when a new user/developer turn arrived before the tool result.

func Transform

func Transform(input Input) (sigma.Request, error)

Transform returns a transformed copy of input.Request for input.TargetModel. It never mutates the caller's request, message content, tool schemas, or provider metadata.

Types

type Compatibility

type Compatibility struct {
	ThinkingAsText                  bool
	AssistantAfterToolResultRepair  bool
	AssistantAfterToolResultMessage sigma.Message
	RequireToolResultName           bool
	ConvertDeveloperRole            bool
	DropUnansweredToolCalls         bool
}

Compatibility describes target-provider constraints that are not represented by generic model metadata.

type Input

type Input struct {
	TargetModel   sigma.Model
	Request       sigma.Request
	Compatibility Compatibility
	Policy        Policy
}

Input describes a provider-neutral request transformation.

type Policy

type Policy struct {
	ThinkingStartDelimiter string
	ThinkingEndDelimiter   string
	AllowUnsupportedImages bool
}

Policy controls lossless request normalization choices.

Jump to

Keyboard shortcuts

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