Skip to content

Commit

Permalink
Merge branch 'main' into make-project-id-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Amnah199 authored Oct 23, 2024
2 parents 3c83eb9 + c09812c commit a5b619f
Show file tree
Hide file tree
Showing 39 changed files with 282 additions and 182 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/weaviate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion integrations/amazon_bedrock/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/amazon_bedrock-v[0-9]*"'

[tool.hatch.envs.default]
installer = "uv"
dependencies = [
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -60,8 +61,9 @@ docs = ["pydoc-markdown pydoc/config.yml"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.lint]
installer = "uv"
detached = true
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"

Expand Down
4 changes: 3 additions & 1 deletion integrations/amazon_sagemaker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/amazon_sagemaker-v[0-9]*"'

[tool.hatch.envs.default]
installer = "uv"
dependencies = [
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -65,8 +66,9 @@ docs = ["pydoc-markdown pydoc/config.yml"]
python = ["3.8", "3.9", "3.10", "3.11"]

[tool.hatch.envs.lint]
installer = "uv"
detached = true
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
style = ["ruff check {args:.}", "black --check --diff {args:.}"]
Expand Down
4 changes: 3 additions & 1 deletion integrations/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/anthropic-v[0-9]*"'

[tool.hatch.envs.default]
installer = "uv"
dependencies = [
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -60,8 +61,9 @@ docs = ["pydoc-markdown pydoc/config.yml"]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.lint]
installer = "uv"
detached = true
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"

Expand Down
17 changes: 11 additions & 6 deletions integrations/astra/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [integrations/astra-v0.10.0] - 2024-10-22

### 🚀 Features

- Update astradb integration for latest client library (#1145)

### ⚙️ Miscellaneous Tasks

- Update ruff linting scripts and settings (#1105)
- Adopt uv as installer (#1142)

## [integrations/astra-v0.9.3] - 2024-09-12

### 🐛 Bug Fixes
Expand All @@ -23,9 +34,7 @@
### 🐛 Bug Fixes

- Fix astra nightly

- Fix typing checks

- `Astra` - Fallback to default filter policy when deserializing retrievers without the init parameter (#896)

### ⚙️ Miscellaneous Tasks
Expand All @@ -50,8 +59,6 @@

- Fix haystack-ai pin (#649)



## [integrations/astra-v0.5.0] - 2024-03-18

### 📚 Documentation
Expand All @@ -75,8 +82,6 @@
This PR will also push the docs to Readme
- Fix integration tests (#450)



## [integrations/astra-v0.4.0] - 2024-02-20

### 📚 Documentation
Expand Down
24 changes: 14 additions & 10 deletions integrations/astra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@

```bash
pip install astra-haystack

```

### Local Development

install astra-haystack package locally to run integration tests:

Open in gitpod:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Anant/astra-haystack/tree/main)

Switch Python version to 3.9 (Requires 3.8+ but not 3.12)
```
Switch Python version to 3.9 (Requires 3.9+ but not 3.12)

```bash
pyenv install 3.9
pyenv local 3.9
```
Expand All @@ -33,7 +34,8 @@ Install requirements
`pip install -r requirements.txt`

Export environment variables
```

```bash
export ASTRA_DB_API_ENDPOINT="https://<id>-<region>.apps.astra.datastax.com"
export ASTRA_DB_APPLICATION_TOKEN="AstraCS:..."
export COLLECTION_NAME="my_collection"
Expand All @@ -49,22 +51,25 @@ or

This package includes Astra Document Store and Astra Embedding Retriever classes that integrate with Haystack, allowing you to easily perform document retrieval or RAG with Astra, and include those functions in Haystack pipelines.

### In order to use the Document Store directly:
### Use the Document Store Directly

Import the Document Store:
```

```python
from haystack_integrations.document_stores.astra import AstraDocumentStore
from haystack.document_stores.types.policy import DuplicatePolicy
```

Load in environment variables:
```

```python
namespace = os.environ.get("ASTRA_DB_KEYSPACE")
collection_name = os.environ.get("COLLECTION_NAME", "haystack_vector_search")
```

Create the Document Store object (API Endpoint and Token are read off the environment):
```

```python
document_store = AstraDocumentStore(
collection_name=collection_name,
namespace=namespace,
Expand All @@ -80,7 +85,7 @@ Then you can use the document store functions like count_document below:

Create the Document Store object like above, then import and create the Pipeline:

```
```python
from haystack import Pipeline
pipeline = Pipeline()
```
Expand All @@ -101,7 +106,6 @@ or,

> Astra DB collection '...' is detected as having the following indexing policy: {...}. This does not match the requested indexing policy for this object: {...}. In particular, there may be stricter limitations on the amount of text each string in a document can store. Consider indexing anew on a fresh collection to be able to store longer texts.

The reason for the warning is that the requested collection already exists on the database, and it is configured to [index all of its fields for search](https://docs.datastax.com/en/astra-db-serverless/api-reference/collections.html#the-indexing-option), possibly implicitly, by default. When the Haystack object tries to create it, it attempts to enforce, instead, an indexing policy tailored to the prospected usage: this is both to enable storing very long texts and to avoid indexing fields that will never be used in filtering a search (indexing those would also have a slight performance cost for writes).

Typically there are two reasons why you may encounter the warning:
Expand Down
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
sentence_transformers==2.2.2
openai==1.6.1
astrapy>=0.7.7
astrapy>=1.5.0,<2.0
11 changes: 6 additions & 5 deletions integrations/astra/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ name = "astra-haystack"
dynamic = ["version"]
description = ''
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = "Apache-2.0"
keywords = []
authors = [{ name = "Anant Corporation", email = "[email protected]" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = ["haystack-ai", "pydantic", "typing_extensions", "astrapy"]
dependencies = ["haystack-ai", "pydantic", "typing_extensions", "astrapy>=1.5.0,<2.0"]

[project.urls]
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/astra#readme"
Expand All @@ -41,6 +40,7 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/astra-v[0-9]*"'

[tool.hatch.envs.default]
installer = "uv"
dependencies = [
"coverage[toml]>=6.5",
"pytest",
Expand All @@ -56,11 +56,12 @@ cov = ["test-cov", "cov-report"]
cov-retry = ["test-cov-retry", "cov-report"]
docs = ["pydoc-markdown pydoc/config.yml"]
[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]
python = ["3.9", "3.10", "3.11"]

[tool.hatch.envs.lint]
installer = "uv"
detached = true
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
dependencies = ["pip", "black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
style = ["ruff check {args:.}", "black --check --diff {args:.}"]
Expand Down
Loading

0 comments on commit a5b619f

Please sign in to comment.