Documentation
¶
Overview ¶
Package agent_types provides types that can be returned by agents.
These objects serve three purposes: - They behave as they were the type they're meant to be (e.g., string for text, image.Image for images) - They can be stringified: String() method to return a string defining the object - They integrate with Go's type system and can be serialized/deserialized
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleAgentInputTypes ¶
func HandleAgentInputTypes(args []interface{}, kwargs map[string]interface{}) ([]interface{}, map[string]interface{})
HandleAgentInputTypes converts AgentTypes to their raw values in function arguments
func HandleAgentOutputTypes ¶
func HandleAgentOutputTypes(output interface{}, outputType string) interface{}
HandleAgentOutputTypes converts outputs to appropriate AgentType based on output type
Types ¶
type AgentAudio ¶
type AgentAudio struct {
// contains filtered or unexported fields
}
AgentAudio represents audio type returned by the agent
func NewAgentAudio ¶
func NewAgentAudio(value interface{}, sampleRate ...int) (*AgentAudio, error)
NewAgentAudio creates a new AgentAudio instance
func (*AgentAudio) SampleRate ¶
func (aa *AgentAudio) SampleRate() int
SampleRate returns the sample rate of the audio
func (*AgentAudio) String ¶
func (aa *AgentAudio) String() string
String implements Stringer interface
type AgentImage ¶
type AgentImage struct {
// contains filtered or unexported fields
}
AgentImage represents image type returned by the agent. Behaves as an image.Image.
func NewAgentImage ¶
func NewAgentImage(value interface{}) (*AgentImage, error)
NewAgentImage creates a new AgentImage instance
func (*AgentImage) Save ¶
func (ai *AgentImage) Save(w io.Writer, format string) error
Save saves the image to the specified writer with the given format
func (*AgentImage) String ¶
func (ai *AgentImage) String() string
String implements Stringer interface
type AgentText ¶
type AgentText struct {
// contains filtered or unexported fields
}
AgentText represents text type returned by the agent. Behaves as a string.
func NewAgentText ¶
NewAgentText creates a new AgentText instance
type AgentType ¶
type AgentType interface {
// ToRaw returns the "raw" version of the object
ToRaw() interface{}
// ToString returns the stringified version of the object
ToString() string
// String implements the Stringer interface
String() string
}
AgentType is the interface that all agent return types must implement