Skip to content

Commit 7333f45

Browse files
Create a workflow to update models' metadata (GH-13)
2 parents d5c6a88 + 2073b77 commit 7333f45

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/models.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: models
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.13"
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
21+
22+
- name: Update models metadata
23+
run: uv run scripts/models.py
24+
25+
- name: Compare models metadata
26+
id: compare
27+
run: |
28+
git diff --exit-code langgraphics/metadata/models.json || echo "::set-output name=differs::true"
29+
30+
- name: Create Pull Request
31+
if: steps.compare.outputs.differs == 'true'
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
base: main
35+
token: ${{ secrets.GH_TOKEN }}
36+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
37+
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
38+
branch: update-models-metadata
39+
branch-suffix: short-commit-hash
40+
title: Update the models metadata
41+
commit-message: Update the models metadata
42+
body: This PR updates the models metadata to keep the repository up-to-date with the upstream model costs.

langgraphics/metadata/models.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25634,4 +25634,4 @@
2563425634
"cache_write": 0
2563525635
}
2563625636
}
25637-
}
25637+
}

0 commit comments

Comments
 (0)