EmitOutput streams output through the emitter in ctx. It returns false when no emitter is attached or output is empty.
(ctx context.Context, output string)
| 72 | // EmitOutput streams output through the emitter in ctx. It returns false when |
| 73 | // no emitter is attached or output is empty. |
| 74 | func EmitOutput(ctx context.Context, output string) bool { |
| 75 | if output == "" { |
| 76 | return false |
| 77 | } |
| 78 | emit, ok := ToolOutputEmitterFromContext(ctx) |
| 79 | if !ok { |
| 80 | return false |
| 81 | } |
| 82 | emit(output) |
| 83 | return true |
| 84 | } |
| 85 | |
| 86 | type ToolCall struct { |
| 87 | ID string `json:"id,omitempty"` |