mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-04 19:35:08 +00:00
Extract the model profile refresh logic into a reusable `workflow_call`
workflow so external repos like `langchain-google` and `langchain-aws`
can run the same daily profile refresh and get auto-PRs without
duplicating the pipeline. The in-monorepo caller becomes a thin wrapper
passing provider JSON.
## Changes
- Add `_refresh_model_profiles.yml` as a reusable `workflow_call`
workflow — accepts a `providers` JSON array of `{provider, data_dir}`
pairs, optional `cli-path` (skips cloning the CLI repo when the caller
already has it), and configurable PR metadata inputs
- External callers get the `langchain-profiles` CLI via sparse checkout
of `langchain-ai/langchain` at a configurable `cli-ref`; the in-monorepo
caller short-circuits with `cli-path: libs/model-profiles`
- Add input validation step using `jq` — rejects non-array JSON and
entries missing `provider`/`data_dir` keys with `::error::` annotations
- Replace the piped `while read` loop with `mapfile`/`for` +
per-provider error handling: one provider failure no longer kills the
rest, and all failures are collected and reported at the end
- Route all `${{ inputs.* }}` expressions through `env:` bindings in
`run:` blocks to prevent script injection from caller-controlled values
- Validate `cli-path` existence before use, with a clear error if the
directory is missing
- Summary step now runs with `if: always()` and handles
failure/success/no-op states separately
- Refactor `refresh_model_profiles.yml` into a thin caller that passes
the 10 in-monorepo providers as JSON
46 lines
2.1 KiB
YAML
46 lines
2.1 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:
|
|
uses: ./.github/workflows/_refresh_model_profiles.yml
|
|
with:
|
|
providers: >-
|
|
[
|
|
{"provider":"anthropic", "data_dir":"libs/partners/anthropic/langchain_anthropic/data"},
|
|
{"provider":"deepseek", "data_dir":"libs/partners/deepseek/langchain_deepseek/data"},
|
|
{"provider":"fireworks-ai", "data_dir":"libs/partners/fireworks/langchain_fireworks/data"},
|
|
{"provider":"groq", "data_dir":"libs/partners/groq/langchain_groq/data"},
|
|
{"provider":"huggingface", "data_dir":"libs/partners/huggingface/langchain_huggingface/data"},
|
|
{"provider":"mistral", "data_dir":"libs/partners/mistralai/langchain_mistralai/data"},
|
|
{"provider":"openai", "data_dir":"libs/partners/openai/langchain_openai/data"},
|
|
{"provider":"openrouter", "data_dir":"libs/partners/openrouter/langchain_openrouter/data"},
|
|
{"provider":"perplexity", "data_dir":"libs/partners/perplexity/langchain_perplexity/data"},
|
|
{"provider":"xai", "data_dir":"libs/partners/xai/langchain_xai/data"}
|
|
]
|
|
cli-path: libs/model-profiles
|
|
add-paths: libs/partners/**/data/_profiles.py
|
|
pr-body: |
|
|
Automated refresh of model profile data for all in-monorepo partner
|
|
integrations via `langchain-profiles refresh`.
|
|
|
|
🤖 Generated by the `refresh_model_profiles` workflow.
|
|
secrets:
|
|
MODEL_PROFILE_BOT_APP_ID: ${{ secrets.MODEL_PROFILE_BOT_APP_ID }}
|
|
MODEL_PROFILE_BOT_PRIVATE_KEY: ${{ secrets.MODEL_PROFILE_BOT_PRIVATE_KEY }}
|