Skip to content

Run llamaindex tests #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,24 @@ jobs:
- name: Run tests
run: |
pytest integrations/openai/tests/unit_tests

llamaindex_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .
pip install integrations/llamaindex[dev]
- name: Run tests
run: |
pytest integrations/llamaindex/tests/unit_tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
from llama_index.core.embeddings import BaseEmbedding
from llama_index.core.tools import FunctionTool
from llama_index.core.tools.types import ToolMetadata
from pydantic import Field, PrivateAttr
from pydantic import Extra, Field, PrivateAttr


class VectorSearchRetrieverTool(FunctionTool, VectorSearchRetrieverToolMixin):
"""Vector search retriever tool implementation."""

class Config:
extra = Extra.allow # allow FunctionTool to set unknown attributes

text_column: Optional[str] = Field(
None,
description="The name of the text column to use for the embeddings. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_vector_search_retriever_tool_description_generation(index_name: str) ->
assert vector_search_tool.metadata.name != ""
assert vector_search_tool.metadata.description != ""
assert vector_search_tool.metadata.fn_schema == VectorSearchRetrieverToolInput
assert vector_search_tool.metadata.name == index_name
assert vector_search_tool.metadata.name == index_name.replace(".", "__")
assert (
"A vector search-based retrieval tool for querying indexed embeddings."
in vector_search_tool.metadata.description
Expand Down