Documentation
¶
Overview ¶
Package responsesexecutor runs stateless, streaming Responses conversations with client-side tools and validated terminal submissions. Clients and route attribution are supplied by the caller; this package never loads credentials.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config[Response any] struct { Model string Attribution agenttrace.Attribution UserPrompt, SystemInstructions, UserPromptSuffix *promptbuilder.Prompt MaxTurns, ToolCallConcurrency int MaxTokens int64 Effort effort.Level Submit submitresult.Options[Response] ResultValidators []callbacks.ResultValidator[Response] ResourceLabels map[string]string }
Config configures a credential-free Responses executor. Zero numeric limits select defaults: 200 turns, 32768 output tokens, and 10 concurrent tools. Concurrent tools must synchronize shared state themselves. Reasoning and cache tokens are subsets of output and input tokens, respectively, not extra usage.
type Interface ¶
type Interface[Request promptbuilder.Bindable, Response any] interface { Execute(context.Context, Request, map[string]toolcall.Tool[Response]) (Response, error) }
Interface executes a native Responses conversation with provider-neutral tools.
func New ¶
func New[Request promptbuilder.Bindable, Response any](client responses.ResponseService, cfg Config[Response]) (Interface[Request, Response], error)
New constructs a native Responses executor using an already configured client. It does not access the network or inspect ambient authentication variables.
Example ¶
package main
import (
"fmt"
"chainguard.dev/driftlessaf/agents/agenttrace"
"chainguard.dev/driftlessaf/agents/executor/openai/responsesexecutor"
"chainguard.dev/driftlessaf/agents/promptbuilder"
"github.com/openai/openai-go/responses"
)
type request struct{}
func (request) Bind(p *promptbuilder.Prompt) (*promptbuilder.Prompt, error) { return p, nil }
func main() {
type answer struct {
Summary string `json:"summary"`
}
prompt, err := promptbuilder.NewPrompt("Inspect the supplied synthetic fixture and submit your result.")
if err != nil {
panic(err)
}
// The application supplies a transport-configured service. Construction
// itself never loads credentials or makes an inference request.
var service responses.ResponseService
_, err = responsesexecutor.New[request](service, responsesexecutor.Config[answer]{
Model: "us.openai.gpt-5.6-sol", UserPrompt: prompt,
Attribution: agenttrace.Attribution{ProviderName: "aws.bedrock", System: "aws.bedrock", LogicalModel: "gpt-5.6-sol", Protocol: "openai-responses"},
MaxTurns: 5, MaxTokens: 2048, ToolCallConcurrency: 1,
})
fmt.Println(err)
}
Output: <nil>