Skip to content
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
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
check-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install package with dev extras
run: pip install -e ".[dev]"

- name: Lint, format check, and typecheck
run: poe check

- name: Unit tests
run: poe test
7 changes: 4 additions & 3 deletions vexrag/core/retrieval/poisoning/adapters/chroma.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import uuid
from collections.abc import Mapping, Sequence
from pathlib import Path
from typing import Any
from typing import Any, cast

from vexrag.core.llm.contracts import EmbeddingClient

Expand Down Expand Up @@ -90,11 +90,12 @@ def add_texts(
for pid in ids:
self._owned_ids.add(pid)
try:
# Chroma Collection.add stubs disagree with our embed/metadata payloads.
self._collection.add(
ids=ids,
embeddings=vectors, # type: ignore[arg-type] # chromadb stubs vs list[list[float]]
embeddings=cast(Any, vectors),
documents=stripped,
metadatas=metadatas, # type: ignore[arg-type] # chromadb Metadata typing
metadatas=cast(Any, metadatas),
)
except Exception as exc:
for pid in ids:
Expand Down
15 changes: 7 additions & 8 deletions vexrag/usecases/config_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Mapping
from pathlib import Path
from typing import Any, cast
from typing import Any

from vexrag.usecases.errors import UseCaseConfigError

Expand Down Expand Up @@ -39,14 +39,13 @@ def dump_yaml(content: Mapping[str, Any]) -> str:
import yaml
except ImportError as exc:
raise UseCaseConfigError("PyYAML is required to write YAML files") from exc
return cast(
str,
yaml.safe_dump(
content,
allow_unicode=True,
sort_keys=False,
),
dumped = yaml.safe_dump(
content,
allow_unicode=True,
sort_keys=False,
)
assert isinstance(dumped, str)
return dumped


def write_yaml(path: Path, content: Mapping[str, Any]) -> None:
Expand Down
Loading