Skip to content

Commit 6325f2c

Browse files
authored
Bump astrapy to 2.x (#91)
* tentative => astrapy2 port * astrapy 2 rc2 * actual astrapy2 dependency (lockfile todo) * regenerate poetry.lock * bump to astrapy 2.0.1
1 parent cbdb633 commit 6325f2c

File tree

3 files changed

+134
-28
lines changed

3 files changed

+134
-28
lines changed

client/astra_assistants/tools/astra_data_api.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@
1212

1313
class AstraDataAPITool(ToolInterface):
1414
def __init__(self, db_url: str, collection_name, vectorize: bool = False, openai_client: OpenAI = None, embedding_model:str = None, namespace: str = None):
15-
client = DataAPIClient(token=os.environ["ASTRA_DB_APPLICATION_TOKEN"])
16-
db = None
17-
if namespace:
18-
db = client.get_database_by_api_endpoint(
19-
db_url,
20-
namespace=namespace,
21-
)
22-
else:
23-
db = client.get_database_by_api_endpoint(
24-
db_url,
25-
)
15+
client = DataAPIClient()
16+
db = client.get_database(
17+
db_url,
18+
token=os.environ["ASTRA_DB_APPLICATION_TOKEN"],
19+
keyspace=namespace, # passing None is on (same as omitting the parameter)
20+
)
2621
self.collection = db.get_collection(collection_name)
2722
self.vectorize = vectorize
2823
self.openai_client = openai_client

client/poetry.lock

Lines changed: 126 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["phact <estevezsebastian@gmail.com>"]
66
readme = "README.md"
77

88
[tool.poetry.dependencies]
9-
python = ">=3.10.0"
9+
python = ">=3.10.0,<4.0"
1010
httpx = "^0.27.0"
1111
openai = "^1.21.0"
1212
litellm = "^1.36.0"
@@ -18,7 +18,7 @@ lsprotocol = "^2023.0.1"
1818
python-lsp-jsonrpc = "^1.1.2"
1919
ruff = ">=0.6.2,<9.0.0"
2020
tree-sitter = "^0.23.0"
21-
astrapy = { version = "^1.2.1", optional = true }
21+
astrapy = { version = ">=2.0.1,<3.0.0", optional = true }
2222
e2b-code-interpreter = { version = "^1.0.1", optional = true }
2323
e2b = { version = "^1.0.1", optional = true }
2424
mcp = ">=0.9.1"

0 commit comments

Comments
 (0)