output

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: EUPL-1.2 Imports: 3 Imported by: 0

Documentation

Overview

Package output provides format-specific post-processing for agent step outputs. It supports JSON validation/parsing and markdown code fence stripping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessOutputFormat

func ProcessOutputFormat(output, format string) (processed string, parsed any, err error)

ProcessOutputFormat applies format-specific processing to agent output. For "json": strips fences then validates/parses JSON. For "text": strips fences only. For "": returns output unchanged with nil parsed data.

func StripCodeFences

func StripCodeFences(input string) string

StripCodeFences removes outermost markdown code fences from input. Returns the inner content or the original input if no fences found.

func ValidateAndParseJSON

func ValidateAndParseJSON(input string) (any, error)

ValidateAndParseJSON validates JSON syntax and parses into map or slice. Returns parsed data as map[string]any or []any, or error if invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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