Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 8da5c5e

Browse files
authored
Merge pull request #33 from pamelafox/githubworkflow
Add GitHub testing workflow
2 parents ffc7a8a + 4a30c88 commit 8da5c5e

File tree

3 files changed

+69
-9
lines changed

3 files changed

+69
-9
lines changed

.github/workflows/python.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Python checks
1+
name: Check example files are linted and formatted
22

33
on:
44
push:
@@ -15,11 +15,15 @@ jobs:
1515
uses: actions/setup-python@v6
1616
with:
1717
python-version: "3.11"
18-
- name: Install dependencies
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
20+
- name: Set up virtual environment and install dependencies
1921
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements-dev.txt
22+
uv venv .venv
23+
uv pip install -r requirements-dev.txt
2224
- name: Lint with ruff
23-
run: ruff check .
25+
run: |
26+
uv run ruff check .
2427
- name: Check formatting with black
25-
run: black . --check --verbose
28+
run: |
29+
uv run black . --check --verbose
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run example files with GitHub models
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
paths:
9+
- 'requirements.txt'
10+
- '.github/workflows/test-github-models.yaml'
11+
- 'chat.py'
12+
- 'spanish/chat.py'
13+
14+
jobs:
15+
test-github-models:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
models: 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-file: "pyproject.toml"
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v6
31+
32+
- name: Install dependencies
33+
run: |
34+
uv venv .venv
35+
uv pip install -r requirements.txt
36+
37+
- name: Test chat files with GitHub Models
38+
env:
39+
API_HOST: github
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GITHUB_MODEL: openai/gpt-4o-mini
42+
run: |
43+
source .venv/bin/activate
44+
files=("chat.py" "spanish/chat.py")
45+
for file in "${files[@]}"; do
46+
echo "Testing $file..."
47+
python "$file" || exit 1
48+
done

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)