codec

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const String = s("string")

String Identity codec

Variables

View Source
var DecoderID = FromDecoder(
	func(reply *chatter.Reply) (float64, *chatter.Reply, error) {
		return 1.0, reply, nil
	},
)

Identity decoder, passes LLM reply directly as result

View Source
var EncoderID = FromEncoder(
	func(q string) (chatter.Message, error) {
		var prompt chatter.Prompt
		prompt.WithTask(q)
		return &prompt, nil
	},
)

Identity encoder, passes input string directly to prompt

Functions

func FromDecoder

func FromDecoder[B any](f func(*chatter.Reply) (float64, B, error)) thinker.Decoder[B]

From is helper to build Decoder[B] interface from pure function.

func FromEncoder

func FromEncoder[A any](f func(A) (chatter.Message, error)) thinker.Encoder[A]

From is helper to build Encoder[A] interface from pure function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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