tools *Toolbox
request ModelRequest
take func() []Message
+ images *ImageStore
}
// Run runs the chain from input, the input of its first request, and returns
input = append(input, outputs...)
for _, message := range c.take() {
- input = append(input, modelUserMessage(message.Text))
+ item, err := imageUserMessage(c.images, message.Text)
+ if err != nil {
+ return nil, "", fmt.Errorf("read queued images: %w", err)
+ }
+
+ input = append(input, item)
}
return input, "", nil
type ChainFunctionCallOutput struct {
Type string `json:"type"`
CallID string `json:"call_id"`
- Output string `json:"output"`
+ Output any `json:"output"`
}
// chainInputItem returns an output item as an input item for the next request.