functioncall

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T any](funcs Funcs) (dest T)

Types

type Func

type Func struct {
	Value       any    `json:"-"`
	Description string `json:"description,omitempty"`
	Parameters  Params `json:"parameters,omitempty"`
}

type Funcs

type Funcs map[string]Func

func (Funcs) Call added in v1.5.0

func (funcs Funcs) Call(invocation Invocation) string

func (Funcs) MarshalJSON

func (funcs Funcs) MarshalJSON() ([]byte, error)

type Invocation added in v1.5.0

type Invocation interface {
	Name() string
	Args() map[string]any
}

type NestedParams added in v1.7.0

type NestedParams []Param

func (NestedParams) MarshalJSON added in v1.7.0

func (params NestedParams) MarshalJSON() ([]byte, error)

type Param

type Param struct {
	Name        string `json:"-"`
	Type        string `json:"type,omitempty"`
	Description string `json:"description,omitempty"`
	Required    bool   `json:"-"`
	// Enum        []any  `json:"enum,omitempty"`
	Items NestedParams `json:",omitempty"`
}

func (Param) MarshalJSON added in v1.7.0

func (param Param) MarshalJSON() ([]byte, error)

type Params

type Params []Param

func (Params) MarshalJSON

func (params Params) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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