transform

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package transform converts agent messages for LLM providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachmentsToLLM

func AttachmentsToLLM(attachments []Attachment) []llms.ContentPart

AttachmentsToLLM converts attachments directly into langchaingo content parts.

func Context

func Context(messages []msg.AgentMessage) ([]msg.AgentMessage, error)

Context applies the default no-op context transform.

func DefaultConvertToLLM

func DefaultConvertToLLM(messages []msg.AgentMessage) ([]llms.MessageContent, error)

DefaultConvertToLLM converts standard agent messages into langchaingo messages.

func FilterContext

func FilterContext(messages []msg.AgentMessage) ([]msg.AgentMessage, error)

FilterContext returns messages unchanged; callers may replace this hook.

func MergeSystemPrompt

func MergeSystemPrompt(base, extra string) string

MergeSystemPrompt prepends a system prompt into agent context without duplicating messages.

func ProcessAttachments

func ProcessAttachments(attachments []Attachment) []msg.ContentPart

ProcessAttachments converts attachments into agent content parts.

Types

type Attachment

type Attachment struct {
	MIMEType string
	Data     []byte
	URL      string
}

Attachment is an input artifact that may become multimodal LLM content.

Jump to

Keyboard shortcuts

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