Skip to content

Commit 2497b19

Browse files
committed
fix: streamify should deepcopy settings before appending a callback
1 parent 901ddcf commit 2497b19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dspy/streaming/streamify.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import logging
44
import threading
55
from asyncio import iscoroutinefunction
6+
from copy import deepcopy
67
from queue import Queue
78
from typing import TYPE_CHECKING, Any, AsyncGenerator, Awaitable, Callable, Generator
89

@@ -161,7 +162,7 @@ async def use_streaming():
161162
elif not iscoroutinefunction(program):
162163
program = asyncify(program)
163164

164-
callbacks = settings.callbacks
165+
callbacks = deepcopy(settings.callbacks)
165166
status_streaming_callback = StatusStreamingCallback(status_message_provider)
166167
if not any(isinstance(c, StatusStreamingCallback) for c in callbacks):
167168
callbacks.append(status_streaming_callback)

0 commit comments

Comments
 (0)