We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6c5988 commit 7d6d4fdCopy full SHA for 7d6d4fd
pkg/anthropic/opts.go
@@ -103,16 +103,16 @@ func OptTemperature(v float32) Opt {
103
// Add a tool
104
func OptTool(value ...*schema.Tool) Opt {
105
return func(o *options) error {
106
- // Check tools
+ // Make a copy of each tool
107
for _, tool := range value {
108
if tool == nil {
109
return ErrBadParameter.With("OptTool")
110
+ } else {
111
+ tool := *tool
112
+ o.Tools = append(o.Tools, &tool)
113
}
114
115
- // Append tools
- o.Tools = append(o.Tools, value...)
-
116
// Return success
117
return nil
118
0 commit comments