mirror of
https://github.com/hwchase17/langchain.git
synced 2026-03-18 11:07:36 +00:00
Extract additional fields from models.dev into `_model_data_to_profile`: `name`, `status`, `release_date`, `last_updated`, `open_weights`, `attachment`, `temperature` Move the model profile refresh logic from an inline bash script in the GitHub Actions workflow into a `make refresh-profiles` target in `libs/model-profiles/Makefile`. This makes it runnable locally with a single command and keeps the provider map in one place instead of duplicated between CI and developer docs.
73 lines
2.5 KiB
YAML
73 lines
2.5 KiB
YAML
# Refreshes model profile data for all in-monorepo partner integrations by
|
|
# pulling the latest metadata from models.dev via the `langchain-profiles` CLI.
|
|
#
|
|
# Creates a pull request with any changes. Runs daily and can be triggered
|
|
# manually from the Actions UI. Uses a fixed branch so each run supersedes
|
|
# any stale PR from a previous run.
|
|
|
|
name: "🔄 Refresh Model Profiles"
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 8 * * *" # daily at 08:00 UTC
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
refresh-profiles:
|
|
name: "refresh all partner profiles"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "📋 Checkout"
|
|
uses: actions/checkout@v6
|
|
|
|
- name: "🐍 Set up Python + uv"
|
|
uses: ./.github/actions/uv_setup
|
|
with:
|
|
python-version: "3.12"
|
|
working-directory: libs/model-profiles
|
|
|
|
- name: "📦 Install langchain-profiles CLI"
|
|
working-directory: libs/model-profiles
|
|
run: uv sync
|
|
|
|
- name: "🔄 Refresh profiles"
|
|
working-directory: libs/model-profiles
|
|
run: make refresh-profiles
|
|
|
|
- name: "🔑 Generate GitHub App token"
|
|
id: app-token
|
|
uses: actions/create-github-app-token@v2
|
|
with:
|
|
app-id: ${{ secrets.MODEL_PROFILE_BOT_APP_ID }}
|
|
private-key: ${{ secrets.MODEL_PROFILE_BOT_PRIVATE_KEY }}
|
|
|
|
- name: "🔀 Create pull request"
|
|
id: create-pr
|
|
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
|
|
with:
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
branch: bot/refresh-model-profiles
|
|
commit-message: "chore(model-profiles): refresh model profile data"
|
|
title: "chore(model-profiles): refresh model profile data"
|
|
body: |
|
|
Automated refresh of model profile data for all in-monorepo partner
|
|
integrations via `langchain-profiles refresh`.
|
|
|
|
🤖 Generated by the `refresh_model_profiles` workflow.
|
|
labels: bot
|
|
add-paths: libs/partners/**/data/_profiles.py
|
|
|
|
- name: "📝 Summary"
|
|
run: |
|
|
op="${{ steps.create-pr.outputs.pull-request-operation }}"
|
|
url="${{ steps.create-pr.outputs.pull-request-url }}"
|
|
if [ "$op" = "created" ] || [ "$op" = "updated" ]; then
|
|
echo "### ✅ PR ${op}: ${url}" >> "$GITHUB_STEP_SUMMARY"
|
|
else
|
|
echo "### ⏭️ Skipped: profiles already up to date" >> "$GITHUB_STEP_SUMMARY"
|
|
fi
|