We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2334456 commit 640d97bCopy full SHA for 640d97b
1 file changed
core/agent/agent.go
@@ -180,6 +180,13 @@ func (a *Agent) SharedState() *types.AgentSharedState {
180
return a.sharedState
181
}
182
183
+// SetStreamCallback sets (or replaces) the stream callback on a live agent.
184
+// This allows callers to wire streaming events after agent creation,
185
+// e.g. in distributed mode where the callback routes to NATS.
186
+func (a *Agent) SetStreamCallback(fn func(cogito.StreamEvent)) {
187
+ a.options.streamCallback = fn
188
+}
189
+
190
// StartConversationConsumer starts the goroutine that dispatches new conversation
191
// messages to subscribers. This must be called when using AskDirect() without Run(),
192
// otherwise the ConversationAction handler will deadlock on the newConversations channel.
0 commit comments