MCPcopy Index your code
hub / github.com/docker/docker-agent / Load

Function Load

pkg/creator/agent.go:38–52  ·  view source on GitHub ↗

Load creates and returns the agent-builder team load result. The agent builder helps users create their own agent configurations interactively. Parameters: - ctx: Context for the operation - runConfig: Runtime configuration including working directory and environment - modelNameOverride: Optional m

(ctx context.Context, runConfig *config.RuntimeConfig, modelNameOverride string)

Source from the content-addressed store, hash-verified

36//
37// Returns the configured team or an error if configuration fails.
38func Load(ctx context.Context, runConfig *config.RuntimeConfig, modelNameOverride string) (*teamloader.LoadResult, error) {
39 instructions := buildInstructions(ctx, runConfig)
40
41 configYAML, err := buildCreatorConfigYAML(instructions)
42 if err != nil {
43 return nil, fmt.Errorf("building creator config: %w", err)
44 }
45
46 return teamloader.LoadWithConfig(
47 ctx,
48 config.NewBytesSource("creator", configYAML),
49 runConfig,
50 append(loaderdefaults.Opts(), teamloader.WithModelOverrides([]string{modelNameOverride}))...,
51 )
52}
53
54// Agent creates and returns a team configured for the agent builder functionality.
55func Agent(ctx context.Context, runConfig *config.RuntimeConfig, modelNameOverride string) (*team.Team, error) {

Callers 2

runNewCommandMethod · 0.92
AgentFunction · 0.70

Calls 5

LoadWithConfigFunction · 0.92
NewBytesSourceFunction · 0.92
WithModelOverridesFunction · 0.92
buildInstructionsFunction · 0.85
buildCreatorConfigYAMLFunction · 0.85

Tested by

no test coverage detected