Skip to content

Commit c2b60db

Browse files
authored
Merge pull request #5 from ASCII125/develop
feat: additional factual tests groq
2 parents a01d46f + dd41812 commit c2b60db

6 files changed

Lines changed: 85 additions & 1 deletion

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Factual Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
factual-tests-groq:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.11"
21+
22+
- name: Install dependencies
23+
run: |
24+
pip install -e ".[groq]"
25+
pip install python-dotenv pillow
26+
27+
- name: Create .env file
28+
run: |
29+
echo "TEST_GROQ_TOKEN=${{ secrets.TEST_GROQ_TOKEN }}" >> .env
30+
31+
- name: Download test image
32+
run: |
33+
curl -sL "${{ secrets.TEST_IMAGE_URL }}" -o /tmp/test_image.jpg
34+
35+
- name: Run Groq factual tests
36+
run: |
37+
python -m tests.factual.groq.test_chat
38+
python -m tests.factual.groq.test_lite /tmp/test_image.jpg
39+
python -m tests.factual.groq.test_zero /tmp/test_image.jpg
40+
python -m tests.factual.groq.test_medium /tmp/test_image.jpg
41+
42+
factual-tests-ollama:
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Set up Python
49+
uses: actions/setup-python@v5
50+
with:
51+
python-version: "3.11"
52+
53+
- name: Install dependencies
54+
run: |
55+
pip install -e ".[ollama]"
56+
pip install python-dotenv pillow
57+
58+
- name: Create .env file
59+
run: |
60+
echo "TEST_OLLAMA_URL=${{ secrets.TEST_OLLAMA_URL }}" >> .env
61+
echo "TEST_OLLAMA_PORT=${{ secrets.TEST_OLLAMA_PORT }}" >> .env
62+
echo "TEST_OLLAMA_HTTPS=${{ secrets.TEST_OLLAMA_HTTPS }}" >> .env
63+
echo "TEST_OLLAMA_API_KEY=${{ secrets.TEST_OLLAMA_API_KEY }}" >> .env
64+
65+
- name: Download test image
66+
run: |
67+
curl -sL "${{ secrets.TEST_IMAGE_URL }}" -o /tmp/test_image.jpg
68+
69+
- name: Run Ollama factual tests
70+
run: |
71+
python -m tests.factual.ollama.test_lite /tmp/test_image.jpg
72+
python -m tests.factual.ollama.test_zero /tmp/test_image.jpg
73+
python -m tests.factual.ollama.test_medium /tmp/test_image.jpg
74+
python -m tests.factual.ollama.test_context_chat /tmp/test_image.jpg

tests/factual/ollama/test_context_chat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ async def main():
2323
model=setup.test_ollama_vision_model,
2424
ollama_ip=setup.test_ollama_url,
2525
ollama_port=setup.test_ollama_port,
26+
ollama_api_key=setup.test_ollama_api_key,
27+
https=setup.test_ollama_https,
2628
)
2729

2830
aiyer = AiyerLite(model=model)

tests/factual/ollama/test_lite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ async def main():
2323
model=setup.test_ollama_vision_model,
2424
ollama_ip=setup.test_ollama_url,
2525
ollama_port=setup.test_ollama_port,
26+
ollama_api_key=setup.test_ollama_api_key,
27+
https=setup.test_ollama_https,
2628
)
2729

2830
aiyer = AiyerLite(model=model)

tests/factual/ollama/test_medium.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ async def main():
2323
model=setup.test_ollama_vision_model,
2424
ollama_ip=setup.test_ollama_url,
2525
ollama_port=setup.test_ollama_port,
26+
ollama_api_key=setup.test_ollama_api_key,
27+
https=setup.test_ollama_https,
2628
)
2729

2830
aiyer = AiyerMedium(model=model)

tests/factual/ollama/test_zero.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ async def main():
2323
model=setup.test_ollama_vision_model,
2424
ollama_ip=setup.test_ollama_url,
2525
ollama_port=setup.test_ollama_port,
26+
ollama_api_key=setup.test_ollama_api_key,
27+
https=setup.test_ollama_https,
2628
)
2729

2830
aiyer = AiyerZero(model=model)

tests/setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ def __init__(self):
1414
self.env_values = dotenv_values(".env")
1515
self.test_ollama_url = self.env_values.get("TEST_OLLAMA_URL")
1616
self.test_ollama_port = int(self.env_values.get("TEST_OLLAMA_PORT", 11434))
17-
self.test_ollama_vision_model = self.env_values.get("TEST_OLLAMA_VISION_MODEL", "qwen3.5:4b")
17+
self.test_ollama_api_key = self.env_values.get("TEST_OLLAMA_API_KEY")
18+
self.test_ollama_https = self.env_values.get("TEST_OLLAMA_HTTPS", "false").lower() == "true"
19+
self.test_ollama_vision_model = self.env_values.get("TEST_OLLAMA_VISION_MODEL", "gemma3:4b")
1820
self.test_groq_token = self.env_values.get("TEST_GROQ_TOKEN")
1921
self.test_groq_model = self.env_values.get("TEST_GROQ_MODEL", "qwen/qwen3-32b")
2022
self.test_groq_vision_model = self.env_values.get("TEST_GROQ_VISION_MODEL", "meta-llama/llama-4-scout-17b-16e-instruct")

0 commit comments

Comments
 (0)