ToolOutputEmitterFromContext returns the incremental-output emitter attached to ctx, if any.
(ctx context.Context)
| 65 | // ToolOutputEmitterFromContext returns the incremental-output emitter attached |
| 66 | // to ctx, if any. |
| 67 | func ToolOutputEmitterFromContext(ctx context.Context) (ToolOutputEmitter, bool) { |
| 68 | emit, ok := ctx.Value(toolOutputEmitterKey{}).(ToolOutputEmitter) |
| 69 | return emit, ok |
| 70 | } |
| 71 | |
| 72 | // EmitOutput streams output through the emitter in ctx. It returns false when |
| 73 | // no emitter is attached or output is empty. |
no test coverage detected