Documentation
¶
Index ¶
Constants ¶
View Source
const ( OperationAdd = "add" OperationReplace = "replace" OperationRemove = "remove" )
View Source
const DefaultUpdateFormSystemPromptTemplate = `` /* 2466-byte string literal not displayed */
DefaultUpdateFormSystemPromptTemplate is the default system prompt template used by ToolBasedPatchGenerator. The template may contain a single "%s" placeholder for the tool name.
Variables ¶
This section is empty.
Functions ¶
func ApplyRFC6902 ¶
Types ¶
type Generator ¶
type Generator[T any] interface { GeneratePatch(ctx context.Context, req *types.ToolRequest[T]) (*UpdateFormArgs, error) }
type GeneratorOption ¶ added in v0.0.2
type GeneratorOption[T any] func(*patchGeneratorOptions[T])
func WithPatchPromptBuilder ¶ added in v0.0.3
func WithPatchPromptBuilder[T any](promptBuilder PromptBuilder[T]) GeneratorOption[T]
func WithPatchSystemPromptTemplate ¶ added in v0.0.2
func WithPatchSystemPromptTemplate[T any](systemPromptTemplate string) GeneratorOption[T]
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)"`
Description string `json:"description,omitempty" jsonschema:"description=Description of the operation, Defaults to empty string"`
}
func FixOperation ¶ added in v0.0.3
type PromptBuilder ¶ added in v0.0.3
type ToolBasedPatchGenerator ¶
type ToolBasedPatchGenerator[T any] struct { Chain *structured.Chain[*types.ToolRequest[T], UpdateFormArgs] }
func NewToolBasedPatchGenerator ¶
func NewToolBasedPatchGenerator[T any](chatModel model.ToolCallingChatModel, opts ...GeneratorOption[T]) (*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"`
}
Click to show internal directories.
Click to hide internal directories.