Skip to content

Commit 0200db3

Browse files
authored
ci: fix latest ragstack-ai tests (#405)
1 parent a704e1a commit 0200db3

File tree

7 files changed

+49
-122
lines changed

7 files changed

+49
-122
lines changed

libs/e2e-tests/e2e_tests/langchain_llamaindex/test_astra.py

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,15 @@
88
from langchain.chains import ConversationalRetrievalChain
99
from langchain_astradb import AstraDBVectorStore as LangChainAstraDBVectorStore
1010

11-
try:
12-
# llamaindex 0.9.x
13-
from llama_index import (
14-
Document,
15-
OpenAIEmbedding,
16-
ServiceContext,
17-
StorageContext,
18-
VectorStoreIndex,
19-
)
20-
from llama_index.llms import OpenAI
21-
from llama_index.vector_stores import (
22-
AstraDBVectorStore,
23-
MetadataFilters,
24-
ExactMatchFilter,
25-
)
26-
except ImportError:
27-
# llamaindex 0.10.x
28-
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
29-
from llama_index.core.schema import Document
30-
from llama_index.core.vector_stores import (
31-
MetadataFilters,
32-
ExactMatchFilter,
33-
)
34-
from llama_index.vector_stores.astra_db import AstraDBVectorStore
35-
from llama_index.embeddings.openai import OpenAIEmbedding
36-
from llama_index.llms.openai import OpenAI
11+
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
12+
from llama_index.core.schema import Document
13+
from llama_index.core.vector_stores import (
14+
MetadataFilters,
15+
ExactMatchFilter,
16+
)
17+
from llama_index.vector_stores.astra_db import AstraDBVectorStore
18+
from llama_index.embeddings.openai import OpenAIEmbedding
19+
from llama_index.llms.openai import OpenAI
3720

3821

3922
from e2e_tests.test_utils import skip_test_due_to_implementation_not_supported

libs/e2e-tests/e2e_tests/llama_index/test_astra.py

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,17 @@
99
is_astra,
1010
)
1111

12-
try:
13-
# llamaindex 0.9.x
14-
from llama_index import (
15-
ServiceContext,
16-
StorageContext,
17-
VectorStoreIndex,
18-
Document,
19-
)
20-
from llama_index.embeddings import BaseEmbedding
21-
from llama_index.llms import OpenAI, LLM
22-
from llama_index.node_parser import SimpleNodeParser
23-
from llama_index.schema import NodeWithScore
24-
from llama_index.vector_stores import (
25-
AstraDBVectorStore,
26-
MetadataFilters,
27-
ExactMatchFilter,
28-
)
29-
except ImportError:
30-
# llamaindex 0.10.x
31-
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
32-
from llama_index.core.embeddings import BaseEmbedding
33-
from llama_index.core.llms import LLM
34-
from llama_index.core.node_parser import SimpleNodeParser
35-
from llama_index.core.schema import NodeWithScore, Document
36-
from llama_index.core.vector_stores import (
37-
MetadataFilters,
38-
ExactMatchFilter,
39-
)
40-
from llama_index.vector_stores.astra_db import AstraDBVectorStore
41-
from llama_index.llms.openai import OpenAI
12+
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
13+
from llama_index.core.embeddings import BaseEmbedding
14+
from llama_index.core.llms import LLM
15+
from llama_index.core.node_parser import SimpleNodeParser
16+
from llama_index.core.schema import NodeWithScore, Document
17+
from llama_index.core.vector_stores import (
18+
MetadataFilters,
19+
ExactMatchFilter,
20+
)
21+
from llama_index.vector_stores.astra_db import AstraDBVectorStore
22+
from llama_index.llms.openai import OpenAI
4223

4324

4425
from e2e_tests.test_utils import skip_test_due_to_implementation_not_supported

libs/e2e-tests/e2e_tests/llama_index/test_compatibility_rag.py

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,24 @@
44
from langchain.embeddings import HuggingFaceInferenceAPIEmbeddings
55
from langchain_google_vertexai import VertexAIEmbeddings
66

7-
try:
8-
# llamaindex 0.9.x
9-
from llama_index import ServiceContext, StorageContext, VectorStoreIndex, Document
10-
from llama_index.embeddings import (
11-
OpenAIEmbedding,
12-
AzureOpenAIEmbedding,
13-
BedrockEmbedding,
14-
)
15-
from llama_index.llms import (
16-
OpenAI,
17-
AzureOpenAI,
18-
Vertex,
19-
Bedrock,
20-
HuggingFaceInferenceAPI,
21-
ChatMessage,
22-
Gemini,
23-
)
24-
from llama_index.multi_modal_llms import GeminiMultiModal
25-
from llama_index.schema import ImageNode
26-
except ImportError:
27-
# llamaindex 0.10.x
28-
from llama_index.core import (
29-
ServiceContext,
30-
StorageContext,
31-
VectorStoreIndex,
32-
Document,
33-
)
34-
from llama_index.core.base.llms.types import ChatMessage
35-
from llama_index.core.schema import ImageNode
36-
from llama_index.llms.openai import OpenAI
37-
from llama_index.llms.azure_openai import AzureOpenAI
38-
from llama_index.embeddings.openai import OpenAIEmbedding
39-
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
40-
from llama_index.embeddings.bedrock import BedrockEmbedding
41-
from llama_index.llms.vertex import Vertex
42-
from llama_index.llms.bedrock import Bedrock
43-
from llama_index.llms.huggingface import HuggingFaceInferenceAPI
44-
from llama_index.llms.gemini import Gemini
45-
from llama_index.multi_modal_llms.gemini import GeminiMultiModal
7+
from llama_index.core import (
8+
ServiceContext,
9+
StorageContext,
10+
VectorStoreIndex,
11+
Document,
12+
)
13+
from llama_index.core.base.llms.types import ChatMessage
14+
from llama_index.core.schema import ImageNode
15+
from llama_index.llms.openai import OpenAI
16+
from llama_index.llms.azure_openai import AzureOpenAI
17+
from llama_index.embeddings.openai import OpenAIEmbedding
18+
from llama_index.embeddings.azure_openai import AzureOpenAIEmbedding
19+
from llama_index.embeddings.bedrock import BedrockEmbedding
20+
from llama_index.llms.vertex import Vertex
21+
from llama_index.llms.bedrock import Bedrock
22+
from llama_index.llms.huggingface import HuggingFaceInferenceAPI
23+
from llama_index.llms.gemini import Gemini
24+
from llama_index.multi_modal_llms.gemini import GeminiMultiModal
4625

4726
from e2e_tests.conftest import (
4827
set_current_test_info,

libs/e2e-tests/e2e_tests/llama_index/test_llama_parse.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@
66
pytest.skip("llama_parse is not supported, skipping tests", allow_module_level=True)
77

88

9-
try:
10-
# llamaindex 0.9.x
11-
from llama_index import ServiceContext, StorageContext, VectorStoreIndex
12-
from llama_index.embeddings import OpenAIEmbedding
13-
from llama_index.llms import OpenAI
14-
except ImportError:
15-
# llamaindex 0.10.x
16-
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
17-
from llama_index.llms.openai import OpenAI
18-
from llama_index.embeddings.openai import OpenAIEmbedding
9+
from llama_index.core import ServiceContext, StorageContext, VectorStoreIndex
10+
from llama_index.llms.openai import OpenAI
11+
from llama_index.embeddings.openai import OpenAIEmbedding
1912

2013

2114
from e2e_tests.conftest import (

libs/e2e-tests/e2e_tests/test_utils/cassandra_vector_store_handler.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,11 @@
1212
from langchain_community.vectorstores.cassandra import Cassandra
1313
from langchain_core.chat_history import BaseChatMessageHistory
1414

15-
try:
16-
# llamaindex 0.9.x
17-
from llama_index.schema import TextNode
18-
from llama_index.vector_stores import CassandraVectorStore
19-
from llama_index.vector_stores.types import (
20-
VectorStoreQuery,
21-
)
22-
except ImportError:
23-
# llamaindex 0.10.x
24-
from llama_index.core.schema import TextNode
25-
from llama_index.vector_stores.cassandra import CassandraVectorStore
26-
from llama_index.core.vector_stores.types import (
27-
VectorStoreQuery,
28-
)
15+
from llama_index.core.schema import TextNode
16+
from llama_index.vector_stores.cassandra import CassandraVectorStore
17+
from llama_index.core.vector_stores.types import (
18+
VectorStoreQuery,
19+
)
2920

3021

3122
from e2e_tests.test_utils import (

libs/e2e-tests/pyproject.ragstack-ai.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ python = ">=3.9,<3.12,!=3.9.7"
1212
ragstack-ai-tests-utils = { path = "../tests-utils", develop = true }
1313
black = "*"
1414
ruff = "*"
15-
google-cloud-aiplatform = "^1.36.4"
15+
llama-index-embeddings-huggingface = "^0.1.0"
16+
llama-index-llms-huggingface = "^0.1.0"
1617
boto3 = "^1.29.6"
17-
huggingface-hub = "^0.20.3"
1818
azure-storage-blob = "^12.19.0"
1919
pillow = "^10.2.0"
2020
python-dotenv = "^1.0.1"

libs/e2e-tests/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ envdir = {toxworkdir}/.ragstack-ai-latest
5757
allowlist_externals = cp
5858
commands =
5959
cp pyproject.ragstack-ai.toml pyproject.toml
60-
poetry add "ragstack-ai@latest" -E langchain-google -E langchain-nvidia
60+
poetry add "ragstack-ai@latest"
6161
poetry lock
6262
poetry install --no-root
6363
poetry run pytest --disable-warnings --junit-xml=results.xml {posargs:e2e_tests}

0 commit comments

Comments
 (0)