patch

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRFC6902

func ApplyRFC6902[T any](current T, ops []Operation) (T, error)

Types

type Generator

type Generator[T any] interface {
	GeneratePatch(ctx context.Context, req *types.ToolRequest[T]) (*UpdateFormArgs, error)
}

type Operation

type Operation struct {
	Op    string `json:"op" jsonschema:"enum=add,enum=replace,enum=remove,description=RFC6902 operation type (add, replace, remove)"`
	Path  string `json:"path" jsonschema:"pattern=^/.*$,description=RFC6902 JSON Pointer, must start with '/'"`
	Value any    `json:"value,omitempty" jsonschema:"description=Value to apply for add/replace operations (optional for remove)"`
}

type ToolBasedPatchGenerator

type ToolBasedPatchGenerator[T any] struct {
	// contains filtered or unexported fields
}

func NewToolBasedPatchGenerator

func NewToolBasedPatchGenerator[T any](chatModel model.ToolCallingChatModel) (*ToolBasedPatchGenerator[T], error)

func (*ToolBasedPatchGenerator[T]) GeneratePatch

func (g *ToolBasedPatchGenerator[T]) GeneratePatch(ctx context.Context, req *types.ToolRequest[T]) (*UpdateFormArgs, error)

type UpdateFormArgs

type UpdateFormArgs struct {
	Ops []Operation `json:"ops" jsonschema:"description=Array of RFC6902 JSON Patch operations to update the form"`
}

Jump to

Keyboard shortcuts

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