Documentation
¶
Index ¶
- type LangfuseTracer
- func (t *LangfuseTracer) AgentMiddleware() adk.AgentMiddleware
- func (t *LangfuseTracer) ChildAgentMiddleware() adk.AgentMiddleware
- func (t *LangfuseTracer) EndChildTrace(ctx context.Context, output string)
- func (t *LangfuseTracer) Flush()
- func (t *LangfuseTracer) WithChildTrace(ctx context.Context, name string) context.Context
- func (t *LangfuseTracer) WithNewTrace(ctx context.Context, name string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LangfuseTracer ¶
type LangfuseTracer struct {
// contains filtered or unexported fields
}
LangfuseTracer wraps the Langfuse client and provides eino integration helpers.
func NewLangfuseTracer ¶
func NewLangfuseTracer(cfg *config.LangfuseConfig) *LangfuseTracer
NewLangfuseTracer creates a LangfuseTracer from the config. Returns nil if required credentials are missing.
func (*LangfuseTracer) AgentMiddleware ¶
func (t *LangfuseTracer) AgentMiddleware() adk.AgentMiddleware
AgentMiddleware returns an adk.AgentMiddleware that records model generations and tool-call spans to Langfuse, keyed by the traceID stored in the context.
func (*LangfuseTracer) ChildAgentMiddleware ¶ added in v0.0.4
func (t *LangfuseTracer) ChildAgentMiddleware() adk.AgentMiddleware
ChildAgentMiddleware returns an adk.AgentMiddleware for child agents (subagents/teammates). It nests generations and tool spans under the parent span stored in context.
func (*LangfuseTracer) EndChildTrace ¶ added in v0.0.4
func (t *LangfuseTracer) EndChildTrace(ctx context.Context, output string)
EndChildTrace closes the child span created by WithChildTrace.
func (*LangfuseTracer) Flush ¶
func (t *LangfuseTracer) Flush()
Flush ensures all buffered events are sent to Langfuse. It blocks at most defaultFlushTimeout to avoid stalling program exit.
func (*LangfuseTracer) WithChildTrace ¶ added in v0.0.4
WithChildTrace creates a child span under the current trace and returns a context carrying both the original traceID and the new parentSpanID. This allows subagent and teammate agent calls to appear as nested spans in Langfuse.
func (*LangfuseTracer) WithNewTrace ¶
WithNewTrace creates a new Langfuse trace and returns a context carrying its ID.