MCPcopy
hub / github.com/docker/docker-agent / TitleGenerator

Method TitleGenerator

pkg/runtime/runtime.go:1241–1251  ·  view source on GitHub ↗

TitleGenerator returns a title generator for automatic session title generation.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1239
1240// TitleGenerator returns a title generator for automatic session title generation.
1241func (r *LocalRuntime) TitleGenerator(ctx context.Context) *sessiontitle.Generator {
1242 a := r.CurrentAgent()
1243 if a == nil {
1244 return nil
1245 }
1246 models := a.TitleModels(ctx)
1247 if len(models) == 0 {
1248 return nil
1249 }
1250 return sessiontitle.New(models[0], models[1:]...)
1251}
1252
1253// getAgentModelID returns the model ID for an agent. The zero ID is
1254// returned when no model is configured.

Callers

nothing calls this directly

Calls 3

CurrentAgentMethod · 0.95
NewFunction · 0.92
TitleModelsMethod · 0.80

Tested by

no test coverage detected