Skip to content

Commit 9ee1ac3

Browse files
committed
Adding agentop_api_key to AsyncBaseMultiOn.__init__ and docstrings
1 parent 5dce6fa commit 9ee1ac3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/multion/client.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class MultiOn(BaseMultiOn):
2828
2929
- api_key: typing.Optional[str].
3030
31+
- agentops_api_key: typing.Optional[str]. If you wish to visualize your MultiOn agent's execution at app.agentops.ai
32+
3133
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
3234
3335
- follow_redirects: typing.Optional[bool]. Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
@@ -38,11 +40,17 @@ class MultiOn(BaseMultiOn):
3840
3941
client = MultiOn(
4042
api_key="YOUR_API_KEY",
43+
agentops_api_key="YOUR_AGENTOPS_API_KEY",
4144
)
4245
"""
4346

4447
@wraps_function(BaseMultiOn.__init__) # type: ignore
45-
def __init__(self, *args, agentops_api_key: typing.Optional[str] = os.getenv("AGENTOPS_API_KEY"), **kwargs):
48+
def __init__(
49+
self,
50+
*args,
51+
agentops_api_key: typing.Optional[str] = os.getenv("AGENTOPS_API_KEY"),
52+
**kwargs
53+
):
4654
super().__init__(*args, **kwargs)
4755
self.sessions = WrappedSessionsClient(client_wrapper=self._client_wrapper)
4856
if agentops_api_key is not None:
@@ -72,7 +80,7 @@ class AsyncMultiOn(AsyncBaseMultiOn):
7280
7381
- api_key: typing.Optional[str].
7482
75-
- agentops_api_key: typing.Optional[str].
83+
- agentops_api_key: typing.Optional[str]. If you wish to visualize your MultiOn agent's execution at app.agentops.ai
7684
7785
- timeout: typing.Optional[float]. The timeout to be used, in seconds, for requests by default the timeout is 60 seconds, unless a custom httpx client is used, in which case a default is not set.
7886
@@ -89,7 +97,12 @@ class AsyncMultiOn(AsyncBaseMultiOn):
8997
"""
9098

9199
@wraps_function(AsyncBaseMultiOn.__init__) # type: ignore
92-
def __init__(self, *args, **kwargs):
100+
def __init__(
101+
self,
102+
*args,
103+
agentops_api_key: typing.Optional[str] = os.getenv("AGENTOPS_API_KEY"),
104+
**kwargs
105+
):
93106
agentops_api_key = kwargs.pop("agentops_api_key", None)
94107
super().__init__(*args, **kwargs)
95108
self.sessions = WrappedAsyncSessionsClient(client_wrapper=self._client_wrapper)

0 commit comments

Comments
 (0)