Documentation
¶
Overview ¶
Package orchestratorcontext provides context-scoped access to the running agent's identity. By injecting an Agent into ctx early in the pipeline (e.g. at Bootstrap / Start), any downstream code can retrieve the agent identity without explicit function parameters.
Usage:
ctx = orchestratorcontext.WithAgent(ctx, orchestratorcontext.Agent{Name: "my-bot"})
…
name := orchestratorcontext.AgentNameFromContext(ctx) // "my-bot"
Index ¶
Constants ¶
const DefaultAgentName = "Genie"
DefaultAgentName is returned when no Agent has been set on the context.
Variables ¶
This section is empty.
Functions ¶
func AgentNameFromContext ¶
AgentNameFromContext is a convenience function that returns the agent's Name from ctx, defaulting to DefaultAgentName.
Types ¶
type Agent ¶
type Agent struct {
Name string
}
Agent holds the identity of the currently running agent. For now it only carries a Name; additional fields (e.g. Version, Description) can be added later without breaking callers.
func AgentFromContext ¶
AgentFromContext extracts the Agent from ctx. If no Agent was set on the context, it returns an Agent whose Name is DefaultAgentName.