Skip to content

Commit 119400d

Browse files
committed
client v2.5.5
1 parent a21d18d commit 119400d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

client/astra_assistants/patch.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ def patched_create(self, *args, **kwargs):
403403
):
404404
# TODO figure out how to get the model from the tool resources
405405
vector_store_id = assistant.tool_resources.file_search.vector_store_ids[0]
406-
file_list_paginator = client.beta.vector_stores.files.list(vector_store_id=vector_store_id)
406+
try:
407+
file_list_paginator = client.beta.vector_stores.files.list(vector_store_id=vector_store_id)
408+
except Exception as e:
409+
file_list_paginator = client.vector_stores.files.list(vector_store_id=vector_store_id)
407410
vs_file = async_helper.run_async(fetch_first_page(file_list_paginator))
408411
if vs_file is not None:
409412
# use the first file
@@ -453,7 +456,10 @@ def patched_create(self, *args, **kwargs):
453456
):
454457
# TODO figure out how to get the model from the tool resources
455458
vector_store_id = assistant.tool_resources.file_search.vector_store_ids[0]
456-
vs_files = client.beta.vector_stores.files.list(vector_store_id=vector_store_id).data
459+
try:
460+
vs_files = client.beta.vector_stores.files.list(vector_store_id=vector_store_id).data
461+
except Exception as e:
462+
vs_files = client.vector_stores.files.list(vector_store_id=vector_store_id).data
457463
if len(vs_files) > 0:
458464
# use the first file
459465
vs_file: VectorStoreFile= vs_files[0]
@@ -503,7 +509,10 @@ async def patched_create(self, *args, **kwargs):
503509
):
504510
# TODO figure out how to get the model from the tool resources
505511
vector_store_id = assistant.tool_resources.file_search.vector_store_ids[0]
506-
vs_files = await client.beta.vector_stores.files.list(vector_store_id=vector_store_id).data
512+
try:
513+
vs_files = await client.beta.vector_stores.files.list(vector_store_id=vector_store_id).data
514+
except Exception as e:
515+
vs_files = await client.vector_stores.files.list(vector_store_id=vector_store_id).data
507516
if len(vs_files) > 0:
508517
# use the first file
509518
vs_file: VectorStoreFile= vs_files[0]

client/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 = "astra-assistants"
3-
version = "2.5.4"
3+
version = "2.5.5"
44
description = "Astra Assistants API - drop in replacement for OpenAI Assistants, powered by AstraDB"
55
authors = ["phact <estevezsebastian@gmail.com>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)