7
7
from .assistants .client import AssistantsClient , AsyncAssistantsClient
8
8
from .calls .client import AsyncCallsClient , CallsClient
9
9
from .core .client_wrapper import AsyncClientWrapper , SyncClientWrapper
10
+ from .core .request_options import RequestOptions
10
11
from .environment import VapiEnvironment
11
12
from .files .client import AsyncFilesClient , FilesClient
12
13
from .knowledge_bases .client import AsyncKnowledgeBasesClient , KnowledgeBasesClient
13
14
from .logs .client import AsyncLogsClient , LogsClient
14
15
from .phone_numbers .client import AsyncPhoneNumbersClient , PhoneNumbersClient
16
+ from .raw_client import AsyncRawVapi , RawVapi
15
17
from .squads .client import AsyncSquadsClient , SquadsClient
16
18
from .test_suite_runs .client import AsyncTestSuiteRunsClient , TestSuiteRunsClient
17
19
from .test_suite_tests .client import AsyncTestSuiteTestsClient , TestSuiteTestsClient
@@ -36,7 +38,7 @@ class Vapi:
36
38
37
39
38
40
39
- token : typing.Union[str, typing.Callable[[], str]]
41
+ token : typing.Optional[typing. Union[str, typing.Callable[[], str] ]]
40
42
timeout : typing.Optional[float]
41
43
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 this default is not enforced.
42
44
@@ -57,7 +59,7 @@ def __init__(
57
59
* ,
58
60
base_url : typing .Optional [str ] = None ,
59
61
environment : VapiEnvironment = VapiEnvironment .DEFAULT ,
60
- token : typing .Union [str , typing .Callable [[], str ]],
62
+ token : typing .Optional [ typing . Union [str , typing .Callable [[], str ]]] = None ,
61
63
timeout : typing .Optional [float ] = None ,
62
64
follow_redirects : typing .Optional [bool ] = True ,
63
65
httpx_client : typing .Optional [httpx .Client ] = None ,
@@ -75,6 +77,7 @@ def __init__(
75
77
else httpx .Client (timeout = _defaulted_timeout ),
76
78
timeout = _defaulted_timeout ,
77
79
)
80
+ self ._raw_client = RawVapi (client_wrapper = self ._client_wrapper )
78
81
self .calls = CallsClient (client_wrapper = self ._client_wrapper )
79
82
self .assistants = AssistantsClient (client_wrapper = self ._client_wrapper )
80
83
self .phone_numbers = PhoneNumbersClient (client_wrapper = self ._client_wrapper )
@@ -89,6 +92,37 @@ def __init__(
89
92
self .analytics = AnalyticsClient (client_wrapper = self ._client_wrapper )
90
93
self .logs = LogsClient (client_wrapper = self ._client_wrapper )
91
94
95
+ @property
96
+ def with_raw_response (self ) -> RawVapi :
97
+ """
98
+ Retrieves a raw implementation of this client that returns raw responses.
99
+
100
+ Returns
101
+ -------
102
+ RawVapi
103
+ """
104
+ return self ._raw_client
105
+
106
+ def prometheus_controller_index (self , * , request_options : typing .Optional [RequestOptions ] = None ) -> None :
107
+ """
108
+ Parameters
109
+ ----------
110
+ request_options : typing.Optional[RequestOptions]
111
+ Request-specific configuration.
112
+
113
+ Returns
114
+ -------
115
+ None
116
+
117
+ Examples
118
+ --------
119
+ from vapi import Vapi
120
+ client = Vapi(token="YOUR_TOKEN", )
121
+ client.prometheus_controller_index()
122
+ """
123
+ _response = self ._raw_client .prometheus_controller_index (request_options = request_options )
124
+ return _response .data
125
+
92
126
93
127
class AsyncVapi :
94
128
"""
@@ -106,7 +140,7 @@ class AsyncVapi:
106
140
107
141
108
142
109
- token : typing.Union[str, typing.Callable[[], str]]
143
+ token : typing.Optional[typing. Union[str, typing.Callable[[], str] ]]
110
144
timeout : typing.Optional[float]
111
145
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 this default is not enforced.
112
146
@@ -127,7 +161,7 @@ def __init__(
127
161
* ,
128
162
base_url : typing .Optional [str ] = None ,
129
163
environment : VapiEnvironment = VapiEnvironment .DEFAULT ,
130
- token : typing .Union [str , typing .Callable [[], str ]],
164
+ token : typing .Optional [ typing . Union [str , typing .Callable [[], str ]]] = None ,
131
165
timeout : typing .Optional [float ] = None ,
132
166
follow_redirects : typing .Optional [bool ] = True ,
133
167
httpx_client : typing .Optional [httpx .AsyncClient ] = None ,
@@ -145,6 +179,7 @@ def __init__(
145
179
else httpx .AsyncClient (timeout = _defaulted_timeout ),
146
180
timeout = _defaulted_timeout ,
147
181
)
182
+ self ._raw_client = AsyncRawVapi (client_wrapper = self ._client_wrapper )
148
183
self .calls = AsyncCallsClient (client_wrapper = self ._client_wrapper )
149
184
self .assistants = AsyncAssistantsClient (client_wrapper = self ._client_wrapper )
150
185
self .phone_numbers = AsyncPhoneNumbersClient (client_wrapper = self ._client_wrapper )
@@ -159,6 +194,40 @@ def __init__(
159
194
self .analytics = AsyncAnalyticsClient (client_wrapper = self ._client_wrapper )
160
195
self .logs = AsyncLogsClient (client_wrapper = self ._client_wrapper )
161
196
197
+ @property
198
+ def with_raw_response (self ) -> AsyncRawVapi :
199
+ """
200
+ Retrieves a raw implementation of this client that returns raw responses.
201
+
202
+ Returns
203
+ -------
204
+ AsyncRawVapi
205
+ """
206
+ return self ._raw_client
207
+
208
+ async def prometheus_controller_index (self , * , request_options : typing .Optional [RequestOptions ] = None ) -> None :
209
+ """
210
+ Parameters
211
+ ----------
212
+ request_options : typing.Optional[RequestOptions]
213
+ Request-specific configuration.
214
+
215
+ Returns
216
+ -------
217
+ None
218
+
219
+ Examples
220
+ --------
221
+ from vapi import AsyncVapi
222
+ import asyncio
223
+ client = AsyncVapi(token="YOUR_TOKEN", )
224
+ async def main() -> None:
225
+ await client.prometheus_controller_index()
226
+ asyncio.run(main())
227
+ """
228
+ _response = await self ._raw_client .prometheus_controller_index (request_options = request_options )
229
+ return _response .data
230
+
162
231
163
232
def _get_base_url (* , base_url : typing .Optional [str ] = None , environment : VapiEnvironment ) -> str :
164
233
if base_url is not None :
0 commit comments