OfCodeExecution. This delegates code execution to a provider-hosted environment. It does not execute code inside your Go application or configure the SDK’s separate sandbox service.
With a compatible model and ctx:
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Use a provider-hosted execution tool where supported.
OfCodeExecution. This delegates code execution to a provider-hosted environment. It does not execute code inside your Go application or configure the SDK’s separate sandbox service.
With a compatible model and ctx:
response, err := model.NewResponses(ctx, &responses.Request{
Input: responses.InputUnion{OfString: utils.Ptr("Use Python to solve 3*x + 11 = 14.")},
Tools: []responses.ToolUnion{{OfCodeExecution: &responses.CodeExecutionTool{
Container: &responses.CodeExecutionToolContainerUnion{
ContainerConfig: &responses.CodeExecutionToolContainerConfig{Type: "auto"},
},
}}},
Parameters: responses.Parameters{
Include: []responses.Includable{responses.IncludableCodeInterpreterCallOutputs},
},
})
if err != nil { return err }
_ = response