# 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 }}
