chore: import upstream snapshot with attribution
Publish BFCL to PyPI / build_and_publish (push) Has been cancelled
Update API Zoo Data / send-updates (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:37:27 +08:00
commit bbfc60cd69
533 changed files with 614535 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
name: Publish BFCL to PyPI
on:
push:
branches: [main]
jobs:
build_and_publish:
if: github.repository == 'ShishirPatil/gorilla'
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # we need full history to count commits
- name: Compute CalVer-serial version
id: ver
run: |
# 1) today's date in UTC -> 2025.06.08
DATE=$(date -u '+%Y.%m.%d')
# 2) how many commits since 00:00 UTC?
COMMITS_TODAY=$(git rev-list --count \
--since="$(date -u '+%Y-%m-%d 00:00')" HEAD)
# 3) serial = commits - 1 (first push → 0)
SERIAL=$((COMMITS_TODAY - 1))
if [ "$SERIAL" -eq 0 ]; then
VERSION="$DATE"
else
VERSION="$DATE.$SERIAL"
fi
echo "Computed version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Build wheel & sdist
env:
# 4) Tell setuptools-scm to *pretend* this is the version
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.ver.outputs.version }}
working-directory: berkeley-function-call-leaderboard
run: |
python -m pip install --upgrade build "setuptools-scm[toml]>=8"
python -m build
ls -l dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: berkeley-function-call-leaderboard/dist/
+67
View File
@@ -0,0 +1,67 @@
name: Update API Zoo Data
on:
push:
branches:
- main
paths:
- 'data/apizoo/**'
jobs:
send-updates:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Install Dependencies
run: sudo apt-get install -y jq curl
- name: Send Updated API Data to Server
run: |
REPO_URL="https://github.com/ShishirPatil/gorilla/blob/main/"
FILES=$(git diff --name-only ${{ github.sha }} ${{ github.event.before }} | grep 'data/apizoo/')
ERROR_FLAG=0
ISSUE_BODY=""
for FILE in $FILES; do
DATA=$(jq -c . < "$FILE")
FILE_URL="${REPO_URL}${FILE}"
JSON_BODY=$(jq --arg file_url "$FILE_URL" 'if type == "array" then map(. + {"file_url": $file_url}) else . + {"file_url": $file_url} end' <<< "$DATA")
TMP_FILE=$(mktemp)
echo "$JSON_BODY" > "$TMP_FILE"
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST -H "Content-Type: application/json" -H "Authorization: Bearer ${{ secrets.APIZOO_UPDATE_TOKEN }}" --data-binary "@$TMP_FILE" https://apizooindex.gorilla-llm.com/api/update)
BODY=$(echo "$RESPONSE" | head -n -1)
HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
if [ "$HTTP_STATUS" -ne 200 ]; then
ERROR_FLAG=1
ISSUE_BODY+="**Error adding API documentation in $FILE to the API Zoo Index**\n\n- HTTP Status: $HTTP_STATUS\n- Response:\n\`\`\`\n"
while read -r line; do
ISSUE_BODY+="$line\n"
done <<< "$BODY"
ISSUE_BODY+="\`\`\`\n\n"
fi
rm "$TMP_FILE"
done
if [ "$ERROR_FLAG" -eq 1 ]; then
echo "ISSUE_BODY<<EOF" >> $GITHUB_ENV
echo "$ISSUE_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "ERRORS_DETECTED=true" >> $GITHUB_ENV
fi
- name: Prepare Issue Content If Errors Were Detected
if: env.ERRORS_DETECTED == 'true'
run: |
echo -e "name: API Zoo Index\nabout: Update Error\n\n**Describe the issue**\nError(s) occurred while adding new API documentation to the API Zoo Index.\n\n$ISSUE_BODY" > issue_content.md
echo "::set-output name=issue_file::issue_content.md"
- name: Create GitHub Issue on Error
if: env.ERRORS_DETECTED == 'true'
uses: peter-evans/create-issue-from-file@v5
with:
title: "[API Zoo] Error Updating API Zoo Index"
content-filepath: ./issue_content.md
labels: apizoo-index
token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,79 @@
name: Validate API Zoo PR
on:
pull_request:
branches:
- main
paths:
- 'data/apizoo/**'
jobs:
check-api-update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install jq
run: sudo apt-get install jq
- name: Check for duplicate APIs
id: check
run: |
FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep 'data/apizoo/')
ERROR_FLAG=0
ISSUE_BODY=""
for FILE in $FILES; do
DATA=$(jq -c . < "$FILE")
TMP_FILE=$(mktemp)
echo "$DATA" > "$TMP_FILE"
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST -H "Content-Type: application/json" --data-binary "@$TMP_FILE" https://apizooindex.gorilla-llm.com/api/validate)
rm "$TMP_FILE"
BODY=$(echo "$RESPONSE" | head -n -1)
HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
echo "Validation response for $FILE: $RESPONSE"
if [ "$HTTP_STATUS" -ne 200 ]; then
ERROR_FLAG=1
ISSUE_BODY+="**Error validating new API documentation in $FILE for duplicates**\n\n- HTTP Status: $HTTP_STATUS\n- Response:\n\`\`\`\n"
while read -r line; do
ISSUE_BODY+="$line\n"
done <<< "$BODY"
ISSUE_BODY+="\`\`\`\n\n"
fi
if [[ "$RESPONSE" == *"\"duplicate\": true"* ]]; then
echo "::set-output name=duplicate::true"
break
fi
done
if [ "$ERROR_FLAG" -eq 1 ]; then
echo "ISSUE_BODY<<EOF" >> $GITHUB_ENV
echo "$ISSUE_BODY" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "ERRORS_DETECTED=true" >> $GITHUB_ENV
fi
- name: Prepare Issue Content If Errors Were Detected
if: env.ERRORS_DETECTED == 'true'
run: |
echo -e "name: API Zoo Index\nabout: Validation Error\n\n**Describe the issue**\nError(s) occurred while validating new API additions to the API Zoo Index.\n\n$ISSUE_BODY" > issue_content.md
echo "::set-output name=issue_file::issue_content.md"
- name: Create GitHub Issue on Error
if: env.ERRORS_DETECTED == 'true'
uses: peter-evans/create-issue-from-file@v5
with:
title: "[API Zoo] Error Validating New Additions To The API Zoo Index"
content-filepath: ./issue_content.md
labels: apizoo-index
token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on PR if duplicate API
if: steps.check.outputs.duplicate == 'true'
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
:warning: **Duplicate API detected**: This PR should not be merged.
token: ${{ secrets.GITHUB_TOKEN }}