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
15 changes: 15 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ jobs:
--color=yes
--verbose --verbosity=10 --capture=no --tb=native --showlocals

- name: Run unit tests for examples
run: >
uv run pytest examples/team_recommender/tests/*.py
--timeout=10
--color=yes
--verbose --verbosity=10 --capture=no --tb=native --showlocals

- name: Run all tests for example 1
run: >
uv run pytest examples/team_recommender/tests/example_1_text_response
--timeout=10
--color=yes
--verbose --verbosity=10 --capture=no --tb=native --showlocals
-k "not test_compute_alignment and not test_reproducing_the_same_text_embedding and not test_response_shows_developer_names and not test_llm_will_hallucinate_given_no_data and not test_cosine_similarity_generated_responses"

- name: Type check Python code
run: uv run mypy src

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
def compute_cosine_similarity(a: list, b: list) -> float:
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))


def compute_alignment(a: list, b: list) -> list:
# Calculate the difference vector
difference_vector = np.subtract(b, a)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def stabilize_float(x: float) -> float:
return struct.unpack("f", struct.pack("f", x))[0]


def create_embedding_object(text, model="text-embedding-3-small"):
def create_embedding_object(text: str, model="text-embedding-3-small") -> dict:
"""
Create an embedding object with metadata

Expand Down
Loading