Skip to content

Commit

Permalink
Astra DB: Add integration usage tracking (#568)
Browse files Browse the repository at this point in the history
* Astra DB: Add integration usage tracking

* Update astra_client.py

* Update requirements.txt

* Fix sorting of imports for ruff linting

* Hardcode the caller name

* Update astra_client.py
  • Loading branch information
erichare authored Mar 18, 2024
1 parent b7d61fd commit 475cfb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion integrations/astra/examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
haystack-ai==2.0.0b4
sentence_transformers==2.2.2
openai==1.6.1
astrapy>=0.7.0
astrapy>=0.7.7
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@

from astrapy.api import APIRequestError
from astrapy.db import AstraDB
from haystack.version import __version__ as integration_version
from pydantic.dataclasses import dataclass

logger = logging.getLogger(__name__)

NON_INDEXED_FIELDS = ["metadata._node_content", "content"]
CALLER_NAME = "haystack"


@dataclass
Expand Down Expand Up @@ -64,7 +66,13 @@ def __init__(
self.namespace = namespace

# Build the Astra DB object
self._astra_db = AstraDB(api_endpoint=api_endpoint, token=token, namespace=namespace)
self._astra_db = AstraDB(
api_endpoint=api_endpoint,
token=token,
namespace=namespace,
caller_name=CALLER_NAME,
caller_version=integration_version,
)

try:
# Create and connect to the newly created collection
Expand Down

0 comments on commit 475cfb2

Please sign in to comment.