File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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