mixpeek 0.8.41__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. mixpeek/__init__.py +93 -1
  2. mixpeek/_base_client.py +2041 -0
  3. mixpeek/_client.py +444 -0
  4. mixpeek/_compat.py +219 -0
  5. mixpeek/_constants.py +14 -0
  6. mixpeek/_exceptions.py +108 -0
  7. mixpeek/_files.py +123 -0
  8. mixpeek/_models.py +785 -0
  9. mixpeek/_qs.py +150 -0
  10. mixpeek/_resource.py +43 -0
  11. mixpeek/_response.py +824 -0
  12. mixpeek/_streaming.py +333 -0
  13. mixpeek/_types.py +217 -0
  14. mixpeek/_utils/__init__.py +55 -0
  15. mixpeek/_utils/_logs.py +25 -0
  16. mixpeek/_utils/_proxy.py +62 -0
  17. mixpeek/_utils/_reflection.py +42 -0
  18. mixpeek/_utils/_streams.py +12 -0
  19. mixpeek/_utils/_sync.py +81 -0
  20. mixpeek/_utils/_transform.py +382 -0
  21. mixpeek/_utils/_typing.py +120 -0
  22. mixpeek/_utils/_utils.py +397 -0
  23. mixpeek/_version.py +4 -0
  24. mixpeek/lib/.keep +4 -0
  25. mixpeek/resources/__init__.py +159 -0
  26. mixpeek/resources/accounts/__init__.py +33 -0
  27. mixpeek/resources/accounts/accounts.py +102 -0
  28. mixpeek/resources/accounts/private.py +232 -0
  29. mixpeek/resources/agent/__init__.py +33 -0
  30. mixpeek/resources/agent/agent.py +225 -0
  31. mixpeek/resources/agent/task.py +189 -0
  32. mixpeek/resources/collections/__init__.py +33 -0
  33. mixpeek/resources/collections/collections.py +459 -0
  34. mixpeek/resources/collections/files.py +679 -0
  35. mixpeek/resources/describe.py +338 -0
  36. mixpeek/resources/embed.py +234 -0
  37. mixpeek/resources/indexes.py +506 -0
  38. mixpeek/resources/read.py +183 -0
  39. mixpeek/resources/recognize.py +183 -0
  40. mixpeek/resources/search.py +542 -0
  41. mixpeek/resources/tasks.py +294 -0
  42. mixpeek/resources/transcribe.py +192 -0
  43. mixpeek/types/__init__.py +19 -0
  44. mixpeek/types/accounts/__init__.py +6 -0
  45. mixpeek/types/accounts/private_update_params.py +25 -0
  46. mixpeek/types/accounts/user.py +32 -0
  47. mixpeek/types/agent/__init__.py +3 -0
  48. mixpeek/types/agent_create_params.py +18 -0
  49. mixpeek/types/agentresponse.py +11 -0
  50. mixpeek/types/collection_search_params.py +29 -0
  51. mixpeek/types/collections/__init__.py +9 -0
  52. mixpeek/types/collections/file_create_params.py +31 -0
  53. mixpeek/types/collections/file_full_params.py +22 -0
  54. mixpeek/types/collections/file_update_params.py +18 -0
  55. mixpeek/types/collections/fileresponse.py +23 -0
  56. mixpeek/types/collections/groupedfiledata.py +38 -0
  57. mixpeek/types/describe_upload_params.py +21 -0
  58. mixpeek/types/describe_url_params.py +20 -0
  59. mixpeek/types/embed_create_params.py +29 -0
  60. mixpeek/types/embeddingresponse.py +15 -0
  61. mixpeek/types/index_face_params.py +23 -0
  62. mixpeek/types/index_upload_params.py +27 -0
  63. mixpeek/types/index_url_params.py +159 -0
  64. mixpeek/types/search_text_params.py +45 -0
  65. mixpeek/types/search_upload_params.py +25 -0
  66. mixpeek/types/search_url_params.py +45 -0
  67. mixpeek/types/taskresponse.py +15 -0
  68. mixpeek/types/transcribe_url_params.py +18 -0
  69. mixpeek-0.10.0.dist-info/METADATA +356 -0
  70. mixpeek-0.10.0.dist-info/RECORD +73 -0
  71. {mixpeek-0.8.41.dist-info → mixpeek-0.10.0.dist-info}/WHEEL +1 -2
  72. mixpeek-0.10.0.dist-info/licenses/LICENSE +201 -0
  73. mixpeek/client.py +0 -27
  74. mixpeek/endpoints/collections.py +0 -86
  75. mixpeek/endpoints/embed.py +0 -66
  76. mixpeek/endpoints/index.py +0 -51
  77. mixpeek/endpoints/register.py +0 -34
  78. mixpeek/endpoints/search.py +0 -67
  79. mixpeek/endpoints/tasks.py +0 -26
  80. mixpeek/endpoints/tools.py +0 -138
  81. mixpeek/exceptions.py +0 -13
  82. mixpeek-0.8.41.dist-info/METADATA +0 -375
  83. mixpeek-0.8.41.dist-info/RECORD +0 -15
  84. mixpeek-0.8.41.dist-info/top_level.txt +0 -1
  85. /mixpeek/{endpoints/__init__.py → py.typed} +0 -0
@@ -0,0 +1,232 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Iterable, Optional
6
+
7
+ import httpx
8
+
9
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
+ from ..._utils import (
11
+ maybe_transform,
12
+ async_maybe_transform,
13
+ )
14
+ from ..._compat import cached_property
15
+ from ..._resource import SyncAPIResource, AsyncAPIResource
16
+ from ..._response import (
17
+ to_raw_response_wrapper,
18
+ to_streamed_response_wrapper,
19
+ async_to_raw_response_wrapper,
20
+ async_to_streamed_response_wrapper,
21
+ )
22
+ from ..._base_client import make_request_options
23
+ from ...types.accounts import private_update_params
24
+ from ...types.accounts.user import User
25
+
26
+ __all__ = ["PrivateResource", "AsyncPrivateResource"]
27
+
28
+
29
+ class PrivateResource(SyncAPIResource):
30
+ @cached_property
31
+ def with_raw_response(self) -> PrivateResourceWithRawResponse:
32
+ """
33
+ This property can be used as a prefix for any HTTP method call to return the
34
+ the raw response object instead of the parsed content.
35
+
36
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
37
+ """
38
+ return PrivateResourceWithRawResponse(self)
39
+
40
+ @cached_property
41
+ def with_streaming_response(self) -> PrivateResourceWithStreamingResponse:
42
+ """
43
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
44
+
45
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
46
+ """
47
+ return PrivateResourceWithStreamingResponse(self)
48
+
49
+ def update(
50
+ self,
51
+ *,
52
+ api_keys: Optional[Iterable[private_update_params.APIKey]] | NotGiven = NOT_GIVEN,
53
+ metadata: Optional[object] | NotGiven = NOT_GIVEN,
54
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55
+ # The extra values given here take precedence over values defined on the client or passed to this method.
56
+ extra_headers: Headers | None = None,
57
+ extra_query: Query | None = None,
58
+ extra_body: Body | None = None,
59
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60
+ ) -> User:
61
+ """
62
+ Update User
63
+
64
+ Args:
65
+ extra_headers: Send extra headers
66
+
67
+ extra_query: Add additional query parameters to the request
68
+
69
+ extra_body: Add additional JSON properties to the request
70
+
71
+ timeout: Override the client-level default timeout for this request, in seconds
72
+ """
73
+ return self._put(
74
+ "/accounts/private/",
75
+ body=maybe_transform(
76
+ {
77
+ "api_keys": api_keys,
78
+ "metadata": metadata,
79
+ },
80
+ private_update_params.PrivateUpdateParams,
81
+ ),
82
+ options=make_request_options(
83
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
84
+ ),
85
+ cast_to=User,
86
+ )
87
+
88
+ def list(
89
+ self,
90
+ *,
91
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
92
+ # The extra values given here take precedence over values defined on the client or passed to this method.
93
+ extra_headers: Headers | None = None,
94
+ extra_query: Query | None = None,
95
+ extra_body: Body | None = None,
96
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
97
+ ) -> User:
98
+ """Get User"""
99
+ return self._get(
100
+ "/accounts/private/",
101
+ options=make_request_options(
102
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103
+ ),
104
+ cast_to=User,
105
+ )
106
+
107
+
108
+ class AsyncPrivateResource(AsyncAPIResource):
109
+ @cached_property
110
+ def with_raw_response(self) -> AsyncPrivateResourceWithRawResponse:
111
+ """
112
+ This property can be used as a prefix for any HTTP method call to return the
113
+ the raw response object instead of the parsed content.
114
+
115
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
116
+ """
117
+ return AsyncPrivateResourceWithRawResponse(self)
118
+
119
+ @cached_property
120
+ def with_streaming_response(self) -> AsyncPrivateResourceWithStreamingResponse:
121
+ """
122
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
123
+
124
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
125
+ """
126
+ return AsyncPrivateResourceWithStreamingResponse(self)
127
+
128
+ async def update(
129
+ self,
130
+ *,
131
+ api_keys: Optional[Iterable[private_update_params.APIKey]] | NotGiven = NOT_GIVEN,
132
+ metadata: Optional[object] | NotGiven = NOT_GIVEN,
133
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134
+ # The extra values given here take precedence over values defined on the client or passed to this method.
135
+ extra_headers: Headers | None = None,
136
+ extra_query: Query | None = None,
137
+ extra_body: Body | None = None,
138
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
139
+ ) -> User:
140
+ """
141
+ Update User
142
+
143
+ Args:
144
+ extra_headers: Send extra headers
145
+
146
+ extra_query: Add additional query parameters to the request
147
+
148
+ extra_body: Add additional JSON properties to the request
149
+
150
+ timeout: Override the client-level default timeout for this request, in seconds
151
+ """
152
+ return await self._put(
153
+ "/accounts/private/",
154
+ body=await async_maybe_transform(
155
+ {
156
+ "api_keys": api_keys,
157
+ "metadata": metadata,
158
+ },
159
+ private_update_params.PrivateUpdateParams,
160
+ ),
161
+ options=make_request_options(
162
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163
+ ),
164
+ cast_to=User,
165
+ )
166
+
167
+ async def list(
168
+ self,
169
+ *,
170
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
171
+ # The extra values given here take precedence over values defined on the client or passed to this method.
172
+ extra_headers: Headers | None = None,
173
+ extra_query: Query | None = None,
174
+ extra_body: Body | None = None,
175
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
176
+ ) -> User:
177
+ """Get User"""
178
+ return await self._get(
179
+ "/accounts/private/",
180
+ options=make_request_options(
181
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
182
+ ),
183
+ cast_to=User,
184
+ )
185
+
186
+
187
+ class PrivateResourceWithRawResponse:
188
+ def __init__(self, private: PrivateResource) -> None:
189
+ self._private = private
190
+
191
+ self.update = to_raw_response_wrapper(
192
+ private.update,
193
+ )
194
+ self.list = to_raw_response_wrapper(
195
+ private.list,
196
+ )
197
+
198
+
199
+ class AsyncPrivateResourceWithRawResponse:
200
+ def __init__(self, private: AsyncPrivateResource) -> None:
201
+ self._private = private
202
+
203
+ self.update = async_to_raw_response_wrapper(
204
+ private.update,
205
+ )
206
+ self.list = async_to_raw_response_wrapper(
207
+ private.list,
208
+ )
209
+
210
+
211
+ class PrivateResourceWithStreamingResponse:
212
+ def __init__(self, private: PrivateResource) -> None:
213
+ self._private = private
214
+
215
+ self.update = to_streamed_response_wrapper(
216
+ private.update,
217
+ )
218
+ self.list = to_streamed_response_wrapper(
219
+ private.list,
220
+ )
221
+
222
+
223
+ class AsyncPrivateResourceWithStreamingResponse:
224
+ def __init__(self, private: AsyncPrivateResource) -> None:
225
+ self._private = private
226
+
227
+ self.update = async_to_streamed_response_wrapper(
228
+ private.update,
229
+ )
230
+ self.list = async_to_streamed_response_wrapper(
231
+ private.list,
232
+ )
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .task import (
4
+ TaskResource,
5
+ AsyncTaskResource,
6
+ TaskResourceWithRawResponse,
7
+ AsyncTaskResourceWithRawResponse,
8
+ TaskResourceWithStreamingResponse,
9
+ AsyncTaskResourceWithStreamingResponse,
10
+ )
11
+ from .agent import (
12
+ AgentResource,
13
+ AsyncAgentResource,
14
+ AgentResourceWithRawResponse,
15
+ AsyncAgentResourceWithRawResponse,
16
+ AgentResourceWithStreamingResponse,
17
+ AsyncAgentResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "TaskResource",
22
+ "AsyncTaskResource",
23
+ "TaskResourceWithRawResponse",
24
+ "AsyncTaskResourceWithRawResponse",
25
+ "TaskResourceWithStreamingResponse",
26
+ "AsyncTaskResourceWithStreamingResponse",
27
+ "AgentResource",
28
+ "AsyncAgentResource",
29
+ "AgentResourceWithRawResponse",
30
+ "AsyncAgentResourceWithRawResponse",
31
+ "AgentResourceWithStreamingResponse",
32
+ "AsyncAgentResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,225 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from .task import (
8
+ TaskResource,
9
+ AsyncTaskResource,
10
+ TaskResourceWithRawResponse,
11
+ AsyncTaskResourceWithRawResponse,
12
+ TaskResourceWithStreamingResponse,
13
+ AsyncTaskResourceWithStreamingResponse,
14
+ )
15
+ from ...types import agent_create_params
16
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
17
+ from ..._utils import (
18
+ maybe_transform,
19
+ strip_not_given,
20
+ async_maybe_transform,
21
+ )
22
+ from ..._compat import cached_property
23
+ from ..._resource import SyncAPIResource, AsyncAPIResource
24
+ from ..._response import (
25
+ to_raw_response_wrapper,
26
+ to_streamed_response_wrapper,
27
+ async_to_raw_response_wrapper,
28
+ async_to_streamed_response_wrapper,
29
+ )
30
+ from ..._base_client import make_request_options
31
+ from ...types.agentresponse import Agentresponse
32
+
33
+ __all__ = ["AgentResource", "AsyncAgentResource"]
34
+
35
+
36
+ class AgentResource(SyncAPIResource):
37
+ @cached_property
38
+ def task(self) -> TaskResource:
39
+ return TaskResource(self._client)
40
+
41
+ @cached_property
42
+ def with_raw_response(self) -> AgentResourceWithRawResponse:
43
+ """
44
+ This property can be used as a prefix for any HTTP method call to return the
45
+ the raw response object instead of the parsed content.
46
+
47
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
48
+ """
49
+ return AgentResourceWithRawResponse(self)
50
+
51
+ @cached_property
52
+ def with_streaming_response(self) -> AgentResourceWithStreamingResponse:
53
+ """
54
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
55
+
56
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
57
+ """
58
+ return AgentResourceWithStreamingResponse(self)
59
+
60
+ def create(
61
+ self,
62
+ *,
63
+ prompt: str,
64
+ authorization: str | NotGiven = NOT_GIVEN,
65
+ index_id: str | NotGiven = NOT_GIVEN,
66
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
67
+ # The extra values given here take precedence over values defined on the client or passed to this method.
68
+ extra_headers: Headers | None = None,
69
+ extra_query: Query | None = None,
70
+ extra_body: Body | None = None,
71
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
72
+ ) -> Agentresponse:
73
+ """
74
+ Start Agent
75
+
76
+ Args:
77
+ index_id: filter by organization
78
+
79
+ extra_headers: Send extra headers
80
+
81
+ extra_query: Add additional query parameters to the request
82
+
83
+ extra_body: Add additional JSON properties to the request
84
+
85
+ timeout: Override the client-level default timeout for this request, in seconds
86
+ """
87
+ extra_headers = {
88
+ **strip_not_given(
89
+ {
90
+ "Authorization": authorization,
91
+ "index-id": index_id,
92
+ }
93
+ ),
94
+ **(extra_headers or {}),
95
+ }
96
+ return self._post(
97
+ "/agent/",
98
+ body=maybe_transform({"prompt": prompt}, agent_create_params.AgentCreateParams),
99
+ options=make_request_options(
100
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
101
+ ),
102
+ cast_to=Agentresponse,
103
+ )
104
+
105
+
106
+ class AsyncAgentResource(AsyncAPIResource):
107
+ @cached_property
108
+ def task(self) -> AsyncTaskResource:
109
+ return AsyncTaskResource(self._client)
110
+
111
+ @cached_property
112
+ def with_raw_response(self) -> AsyncAgentResourceWithRawResponse:
113
+ """
114
+ This property can be used as a prefix for any HTTP method call to return the
115
+ the raw response object instead of the parsed content.
116
+
117
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
118
+ """
119
+ return AsyncAgentResourceWithRawResponse(self)
120
+
121
+ @cached_property
122
+ def with_streaming_response(self) -> AsyncAgentResourceWithStreamingResponse:
123
+ """
124
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
125
+
126
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
127
+ """
128
+ return AsyncAgentResourceWithStreamingResponse(self)
129
+
130
+ async def create(
131
+ self,
132
+ *,
133
+ prompt: str,
134
+ authorization: str | NotGiven = NOT_GIVEN,
135
+ index_id: str | NotGiven = NOT_GIVEN,
136
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
137
+ # The extra values given here take precedence over values defined on the client or passed to this method.
138
+ extra_headers: Headers | None = None,
139
+ extra_query: Query | None = None,
140
+ extra_body: Body | None = None,
141
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
142
+ ) -> Agentresponse:
143
+ """
144
+ Start Agent
145
+
146
+ Args:
147
+ index_id: filter by organization
148
+
149
+ extra_headers: Send extra headers
150
+
151
+ extra_query: Add additional query parameters to the request
152
+
153
+ extra_body: Add additional JSON properties to the request
154
+
155
+ timeout: Override the client-level default timeout for this request, in seconds
156
+ """
157
+ extra_headers = {
158
+ **strip_not_given(
159
+ {
160
+ "Authorization": authorization,
161
+ "index-id": index_id,
162
+ }
163
+ ),
164
+ **(extra_headers or {}),
165
+ }
166
+ return await self._post(
167
+ "/agent/",
168
+ body=await async_maybe_transform({"prompt": prompt}, agent_create_params.AgentCreateParams),
169
+ options=make_request_options(
170
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
171
+ ),
172
+ cast_to=Agentresponse,
173
+ )
174
+
175
+
176
+ class AgentResourceWithRawResponse:
177
+ def __init__(self, agent: AgentResource) -> None:
178
+ self._agent = agent
179
+
180
+ self.create = to_raw_response_wrapper(
181
+ agent.create,
182
+ )
183
+
184
+ @cached_property
185
+ def task(self) -> TaskResourceWithRawResponse:
186
+ return TaskResourceWithRawResponse(self._agent.task)
187
+
188
+
189
+ class AsyncAgentResourceWithRawResponse:
190
+ def __init__(self, agent: AsyncAgentResource) -> None:
191
+ self._agent = agent
192
+
193
+ self.create = async_to_raw_response_wrapper(
194
+ agent.create,
195
+ )
196
+
197
+ @cached_property
198
+ def task(self) -> AsyncTaskResourceWithRawResponse:
199
+ return AsyncTaskResourceWithRawResponse(self._agent.task)
200
+
201
+
202
+ class AgentResourceWithStreamingResponse:
203
+ def __init__(self, agent: AgentResource) -> None:
204
+ self._agent = agent
205
+
206
+ self.create = to_streamed_response_wrapper(
207
+ agent.create,
208
+ )
209
+
210
+ @cached_property
211
+ def task(self) -> TaskResourceWithStreamingResponse:
212
+ return TaskResourceWithStreamingResponse(self._agent.task)
213
+
214
+
215
+ class AsyncAgentResourceWithStreamingResponse:
216
+ def __init__(self, agent: AsyncAgentResource) -> None:
217
+ self._agent = agent
218
+
219
+ self.create = async_to_streamed_response_wrapper(
220
+ agent.create,
221
+ )
222
+
223
+ @cached_property
224
+ def task(self) -> AsyncTaskResourceWithStreamingResponse:
225
+ return AsyncTaskResourceWithStreamingResponse(self._agent.task)
@@ -0,0 +1,189 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from ..._utils import strip_not_given
9
+ from ..._compat import cached_property
10
+ from ..._resource import SyncAPIResource, AsyncAPIResource
11
+ from ..._response import (
12
+ to_raw_response_wrapper,
13
+ to_streamed_response_wrapper,
14
+ async_to_raw_response_wrapper,
15
+ async_to_streamed_response_wrapper,
16
+ )
17
+ from ..._base_client import make_request_options
18
+
19
+ __all__ = ["TaskResource", "AsyncTaskResource"]
20
+
21
+
22
+ class TaskResource(SyncAPIResource):
23
+ @cached_property
24
+ def with_raw_response(self) -> TaskResourceWithRawResponse:
25
+ """
26
+ This property can be used as a prefix for any HTTP method call to return the
27
+ the raw response object instead of the parsed content.
28
+
29
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
30
+ """
31
+ return TaskResourceWithRawResponse(self)
32
+
33
+ @cached_property
34
+ def with_streaming_response(self) -> TaskResourceWithStreamingResponse:
35
+ """
36
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
+
38
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
39
+ """
40
+ return TaskResourceWithStreamingResponse(self)
41
+
42
+ def retrieve(
43
+ self,
44
+ task_id: str,
45
+ *,
46
+ authorization: str | NotGiven = NOT_GIVEN,
47
+ index_id: str | NotGiven = NOT_GIVEN,
48
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
49
+ # The extra values given here take precedence over values defined on the client or passed to this method.
50
+ extra_headers: Headers | None = None,
51
+ extra_query: Query | None = None,
52
+ extra_body: Body | None = None,
53
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
54
+ ) -> object:
55
+ """
56
+ Get Agent Result
57
+
58
+ Args:
59
+ index_id: filter by organization
60
+
61
+ extra_headers: Send extra headers
62
+
63
+ extra_query: Add additional query parameters to the request
64
+
65
+ extra_body: Add additional JSON properties to the request
66
+
67
+ timeout: Override the client-level default timeout for this request, in seconds
68
+ """
69
+ if not task_id:
70
+ raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
71
+ extra_headers = {
72
+ **strip_not_given(
73
+ {
74
+ "Authorization": authorization,
75
+ "index-id": index_id,
76
+ }
77
+ ),
78
+ **(extra_headers or {}),
79
+ }
80
+ return self._get(
81
+ f"/agent/{task_id}",
82
+ options=make_request_options(
83
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
84
+ ),
85
+ cast_to=object,
86
+ )
87
+
88
+
89
+ class AsyncTaskResource(AsyncAPIResource):
90
+ @cached_property
91
+ def with_raw_response(self) -> AsyncTaskResourceWithRawResponse:
92
+ """
93
+ This property can be used as a prefix for any HTTP method call to return the
94
+ the raw response object instead of the parsed content.
95
+
96
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
97
+ """
98
+ return AsyncTaskResourceWithRawResponse(self)
99
+
100
+ @cached_property
101
+ def with_streaming_response(self) -> AsyncTaskResourceWithStreamingResponse:
102
+ """
103
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
104
+
105
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
106
+ """
107
+ return AsyncTaskResourceWithStreamingResponse(self)
108
+
109
+ async def retrieve(
110
+ self,
111
+ task_id: str,
112
+ *,
113
+ authorization: str | NotGiven = NOT_GIVEN,
114
+ index_id: str | NotGiven = NOT_GIVEN,
115
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
116
+ # The extra values given here take precedence over values defined on the client or passed to this method.
117
+ extra_headers: Headers | None = None,
118
+ extra_query: Query | None = None,
119
+ extra_body: Body | None = None,
120
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
121
+ ) -> object:
122
+ """
123
+ Get Agent Result
124
+
125
+ Args:
126
+ index_id: filter by organization
127
+
128
+ extra_headers: Send extra headers
129
+
130
+ extra_query: Add additional query parameters to the request
131
+
132
+ extra_body: Add additional JSON properties to the request
133
+
134
+ timeout: Override the client-level default timeout for this request, in seconds
135
+ """
136
+ if not task_id:
137
+ raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
138
+ extra_headers = {
139
+ **strip_not_given(
140
+ {
141
+ "Authorization": authorization,
142
+ "index-id": index_id,
143
+ }
144
+ ),
145
+ **(extra_headers or {}),
146
+ }
147
+ return await self._get(
148
+ f"/agent/{task_id}",
149
+ options=make_request_options(
150
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
151
+ ),
152
+ cast_to=object,
153
+ )
154
+
155
+
156
+ class TaskResourceWithRawResponse:
157
+ def __init__(self, task: TaskResource) -> None:
158
+ self._task = task
159
+
160
+ self.retrieve = to_raw_response_wrapper(
161
+ task.retrieve,
162
+ )
163
+
164
+
165
+ class AsyncTaskResourceWithRawResponse:
166
+ def __init__(self, task: AsyncTaskResource) -> None:
167
+ self._task = task
168
+
169
+ self.retrieve = async_to_raw_response_wrapper(
170
+ task.retrieve,
171
+ )
172
+
173
+
174
+ class TaskResourceWithStreamingResponse:
175
+ def __init__(self, task: TaskResource) -> None:
176
+ self._task = task
177
+
178
+ self.retrieve = to_streamed_response_wrapper(
179
+ task.retrieve,
180
+ )
181
+
182
+
183
+ class AsyncTaskResourceWithStreamingResponse:
184
+ def __init__(self, task: AsyncTaskResource) -> None:
185
+ self._task = task
186
+
187
+ self.retrieve = async_to_streamed_response_wrapper(
188
+ task.retrieve,
189
+ )