8
8
import weave
9
9
from weave .integrations .patcher import MultiPatcher , NoOpPatcher , SymbolPatcher
10
10
from weave .trace .autopatch import IntegrationSettings , OpSettings
11
- from weave .trace .op import _IteratorWrapper , add_accumulator
11
+ from weave .trace .op import _add_accumulator , _IteratorWrapper
12
12
13
13
if TYPE_CHECKING :
14
14
from anthropic .lib .streaming import MessageStream
@@ -77,7 +77,7 @@ def wrapper(fn: Callable) -> Callable:
77
77
"We need to do this so we can check if `stream` is used"
78
78
op_kwargs = settings .model_dump ()
79
79
op = weave .op (fn , ** op_kwargs )
80
- return add_accumulator (
80
+ return _add_accumulator (
81
81
op , # type: ignore
82
82
make_accumulator = lambda inputs : anthropic_accumulator ,
83
83
should_accumulate = should_use_accumulator ,
@@ -101,7 +101,7 @@ async def _async_wrapper(*args: Any, **kwargs: Any) -> Any:
101
101
"We need to do this so we can check if `stream` is used"
102
102
op_kwargs = settings .model_dump ()
103
103
op = weave .op (_fn_wrapper (fn ), ** op_kwargs )
104
- return add_accumulator (
104
+ return _add_accumulator (
105
105
op , # type: ignore
106
106
make_accumulator = lambda inputs : anthropic_accumulator ,
107
107
should_accumulate = should_use_accumulator ,
@@ -170,7 +170,7 @@ def create_stream_wrapper(settings: OpSettings) -> Callable[[Callable], Callable
170
170
def wrapper (fn : Callable ) -> Callable :
171
171
op_kwargs = settings .model_dump ()
172
172
op = weave .op (fn , ** op_kwargs )
173
- return add_accumulator (
173
+ return _add_accumulator (
174
174
op , # type: ignore
175
175
make_accumulator = lambda _ : anthropic_stream_accumulator ,
176
176
should_accumulate = lambda _ : True ,
0 commit comments