codec

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Identity decoder, passes LLM reply directly as result

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

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.Prompt, 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