Skip to content

Commit 6243fa0

Browse files
committed
Release v0.2.31
1 parent 980c929 commit 6243fa0

File tree

3 files changed

+84
-2
lines changed

3 files changed

+84
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "superagent-py"
3-
version = "v0.2.30"
3+
version = "v0.2.31"
44
description = ""
55
readme = "README.md"
66
authors = []

src/superagent/core/client_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]:
1616
headers: typing.Dict[str, str] = {
1717
"X-Fern-Language": "Python",
1818
"X-Fern-SDK-Name": "superagent-py",
19-
"X-Fern-SDK-Version": "v0.2.30",
19+
"X-Fern-SDK-Version": "v0.2.31",
2020
}
2121
token = self._get_token()
2222
if token is not None:

src/superagent/resources/vector_database/client.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,47 @@ def get(
153153
raise ApiError(status_code=_response.status_code, body=_response.text)
154154
raise ApiError(status_code=_response.status_code, body=_response_json)
155155

156+
def delete(self, vector_db_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
157+
"""
158+
Delete a Vector Database
159+
160+
Parameters:
161+
- vector_db_id: str.
162+
163+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
164+
"""
165+
_response = self._client_wrapper.httpx_client.request(
166+
"DELETE",
167+
urllib.parse.urljoin(
168+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}"
169+
),
170+
params=jsonable_encoder(
171+
request_options.get("additional_query_parameters") if request_options is not None else None
172+
),
173+
headers=jsonable_encoder(
174+
remove_none_from_dict(
175+
{
176+
**self._client_wrapper.get_headers(),
177+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
178+
}
179+
)
180+
),
181+
timeout=request_options.get("timeout_in_seconds")
182+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
183+
else 60,
184+
retries=0,
185+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
186+
)
187+
if 200 <= _response.status_code < 300:
188+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
189+
if _response.status_code == 422:
190+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
191+
try:
192+
_response_json = _response.json()
193+
except JSONDecodeError:
194+
raise ApiError(status_code=_response.status_code, body=_response.text)
195+
raise ApiError(status_code=_response.status_code, body=_response_json)
196+
156197
def update(
157198
self,
158199
vector_db_id: str,
@@ -338,6 +379,47 @@ async def get(
338379
raise ApiError(status_code=_response.status_code, body=_response.text)
339380
raise ApiError(status_code=_response.status_code, body=_response_json)
340381

382+
async def delete(self, vector_db_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
383+
"""
384+
Delete a Vector Database
385+
386+
Parameters:
387+
- vector_db_id: str.
388+
389+
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
390+
"""
391+
_response = await self._client_wrapper.httpx_client.request(
392+
"DELETE",
393+
urllib.parse.urljoin(
394+
f"{self._client_wrapper.get_base_url()}/", f"api/v1/vector-dbs/{jsonable_encoder(vector_db_id)}"
395+
),
396+
params=jsonable_encoder(
397+
request_options.get("additional_query_parameters") if request_options is not None else None
398+
),
399+
headers=jsonable_encoder(
400+
remove_none_from_dict(
401+
{
402+
**self._client_wrapper.get_headers(),
403+
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
404+
}
405+
)
406+
),
407+
timeout=request_options.get("timeout_in_seconds")
408+
if request_options is not None and request_options.get("timeout_in_seconds") is not None
409+
else 60,
410+
retries=0,
411+
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
412+
)
413+
if 200 <= _response.status_code < 300:
414+
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
415+
if _response.status_code == 422:
416+
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
417+
try:
418+
_response_json = _response.json()
419+
except JSONDecodeError:
420+
raise ApiError(status_code=_response.status_code, body=_response.text)
421+
raise ApiError(status_code=_response.status_code, body=_response_json)
422+
341423
async def update(
342424
self,
343425
vector_db_id: str,

0 commit comments

Comments
 (0)