Skip to content

Commit 609a67b

Browse files
committed
Add GitHub testing workflow
1 parent 49d9418 commit 609a67b

2 files changed

Lines changed: 61 additions & 3 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test GitHub Models
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
# Also run when chat.py files are modified
9+
paths:
10+
- 'chat.py'
11+
- 'spanish/chat.py'
12+
- 'requirements.txt'
13+
- '.github/workflows/test-github-models.yaml'
14+
15+
jobs:
16+
test-github-models:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- uses: actions/checkout@v5
23+
24+
- name: Set up Python 3.11
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements.txt
33+
34+
- name: Test main chat.py with GitHub Models
35+
env:
36+
API_HOST: github
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
GITHUB_MODEL: gpt-4o-mini
39+
run: |
40+
echo "Testing main chat.py file..."
41+
python chat.py
42+
43+
- name: Test Spanish chat.py with GitHub Models
44+
env:
45+
API_HOST: github
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
GITHUB_MODEL: gpt-4o-mini
48+
run: |
49+
echo "Testing Spanish chat.py file..."
50+
python spanish/chat.py

reasoning.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,19 @@
3737
messages=[
3838
{
3939
"role": "user",
40-
"content": "Multiply together 1897234 and 12903812039.",
40+
"content": "How many r's are in strawberry? Answer in a complete sentence with explanation.",
4141
},
4242
],
43-
reasoning_effort="minimal",
44-
verbosity="low",
43+
reasoning_effort="low",
4544
)
45+
46+
# Reasoning contnet is only available for gpt-oss models running on Ollama
47+
# To see reasoning traces with gpt-5 family, use the Responses API
48+
if hasattr(response.choices[0].message, "reasoning"):
49+
print("🤔 Thinking...")
50+
print(response.choices[0].message.reasoning)
51+
print("🛑 Done thinking.")
52+
print("Response:")
4653
print(response.choices[0].message.content)
54+
print("Usage:")
4755
print(response.usage)

0 commit comments

Comments
 (0)