Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python checks
name: Check example files are linted and formatted

on:
push:
Expand All @@ -15,11 +15,15 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up virtual environment and install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
uv venv .venv
uv pip install -r requirements-dev.txt
- name: Lint with ruff
run: ruff check .
run: |
uv run ruff check .
- name: Check formatting with black
run: black . --check --verbose
run: |
uv run black . --check --verbose
48 changes: 48 additions & 0 deletions .github/workflows/test-github-models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run example files with GitHub models

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
paths:
- 'requirements.txt'
- '.github/workflows/test-github-models.yaml'
- 'chat.py'
- 'spanish/chat.py'

jobs:
test-github-models:
runs-on: ubuntu-latest
permissions:
contents: read
models: read

steps:
- uses: actions/checkout@v5

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: |
uv venv .venv
uv pip install -r requirements.txt

- name: Test chat files with GitHub Models
env:
API_HOST: github
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_MODEL: openai/gpt-4o-mini
run: |
source .venv/bin/activate
files=("chat.py" "spanish/chat.py")
for file in "${files[@]}"; do
echo "Testing $file..."
python "$file" || exit 1
done
14 changes: 11 additions & 3 deletions reasoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@
messages=[
{
"role": "user",
"content": "Multiply together 1897234 and 12903812039.",
"content": "How many r's are in strawberry? Answer in a complete sentence with explanation.",
},
],
reasoning_effort="minimal",
verbosity="low",
reasoning_effort="low",
)

# Reasoning contnet is only available for gpt-oss models running on Ollama
# To see reasoning traces with gpt-5 family, use the Responses API
if hasattr(response.choices[0].message, "reasoning"):
print("🤔 Thinking...")
print(response.choices[0].message.reasoning)
print("🛑 Done thinking.")
print("Response:")
print(response.choices[0].message.content)
print("Usage:")
print(response.usage)
Loading