This repository was archived by the owner on Oct 16, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +69
-9
lines changed Expand file tree Collapse file tree 3 files changed +69
-9
lines changed Original file line number Diff line number Diff line change 1- name : Python checks
1+ name : Check example files are linted and formatted
22
33on :
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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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:" )
4653print (response .choices [0 ].message .content )
54+ print ("Usage:" )
4755print (response .usage )
You can’t perform that action at this time.
0 commit comments