Skip to content

Commit bdad989

Browse files
committed
Moved retrieve due to sdk change
1 parent 32ed44c commit bdad989

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/multion/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010

1111
from .wrappers import wraps_function
12+
from .types.retrieve_output import RetrieveOutput
1213

1314

1415
# this is used as the default value for optional parameters
@@ -66,6 +67,12 @@ def browse(self, *args, **kwargs):
6667
agentops.start_session(tags=["multion-sdk"])
6768
return super().browse(*args, **kwargs)
6869

70+
@agentops.record_function(event_name="retrieve") # type: ignore
71+
@wraps_function(BaseMultiOn.retrieve)
72+
def retrieve(self, *args, **kwargs) -> RetrieveOutput:
73+
agentops.start_session(tags=["multion-sdk"])
74+
return super().retrieve(*args, **kwargs)
75+
6976

7077
class AsyncMultiOn(AsyncBaseMultiOn):
7178
"""
@@ -117,3 +124,9 @@ def __init__(
117124
async def browse(self, *args, **kwargs):
118125
agentops.start_session(tags=["multion-sdk"])
119126
return super().browse(*args, **kwargs)
127+
128+
@agentops.record_function(event_name="retrieve") # type: ignore
129+
@wraps_function(BaseMultiOn.retrieve)
130+
async def retrieve(self, *args, **kwargs) -> RetrieveOutput:
131+
agentops.start_session(tags=["multion-sdk"])
132+
return super().retrieve(*args, **kwargs)

src/multion/sessions/wrapped_client.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from agentops import ActionEvent, LLMEvent, ErrorEvent # type: ignore
44

55
import typing
6-
from ..types.retrieve_output import RetrieveOutput
76
from ..types.session_created import SessionCreated
87
from ..types.session_step_stream_chunk import SessionStepStreamChunk
98
from ..types.session_step_success import SessionStepSuccess
@@ -14,6 +13,7 @@
1413

1514
from ..wrappers import wraps_function
1615

16+
1717
class WrappedSessionsClient(SessionsClient):
1818
@wraps_function(SessionsClient.create) # type: ignore
1919
def create(self, *args, **kwargs) -> SessionCreated:
@@ -50,7 +50,7 @@ def generator():
5050
yield chunk
5151

5252
return generator()
53-
53+
5454
@agentops.record_function(event_name="step") # type: ignore
5555
@wraps_function(SessionsClient.step)
5656
def step(self, *args, **kwargs) -> SessionStepSuccess:
@@ -66,10 +66,6 @@ def close(self, *args, **kwargs) -> SessionsCloseResponse:
6666
agentops.end_session("Success")
6767
return close_response
6868

69-
@agentops.record_function(event_name="retrieve") # type: ignore
70-
@wraps_function(SessionsClient.retrieve)
71-
def retrieve(self, *args, **kwargs) -> RetrieveOutput:
72-
return super().retrieve(*args, **kwargs)
7369

7470
class WrappedAsyncSessionsClient(AsyncSessionsClient):
7571
@wraps_function(AsyncSessionsClient.create) # type: ignore

0 commit comments

Comments
 (0)